As a rule, a CTE will NEVER improve performance. A CTE is essentially a disposable view. There are no additional statistics stored, no indexes, etc. It functions as a shorthand for a subquery. In my opinion they can be EASILY overused (I see a lot of overuse in code in my job).
Check the cupcakes at the minimum baking time. If the recommended baking time is 18-22 minutes, check them at 17 or 18 minutes (just a quick peek, make sure not to let too much heat out of the oven). If the tops are rounded and no long appear wet, they may be done.
Grease a standard muffin pan, or line with greased cupcake papers. To make the cupcakes: Combine the dry ingredients, then mix in the butter until crumbly. Whisk together the eggs, milk, and vanilla. Stir the wet ingredients into the dry in two additions. Scoop about 1/3 cup batter into each muffin cup. Bake the cupcakes for 16 to 18 minutes, until they're lightly browned and a toothpick inserted into the center of one of the middle cupcakes comes out clean.