Pd-catalyzed sequential C-C and C-N bond formations for the synthesis of N-heterocycles: exploiting protecting group-directed C-H activation under modified reaction conditions.