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.
1 Spoon into cupcake pans to fill about 2/3 to 3/4 full. 2  Bake for 30 minutes in the preheated oven, until golden brown. 3  Remove from the oven and cool for 5 to 10 minutes. 4  To make the sour cream topping, whisk together the sour cream, 1 cup sugar, and vanilla until smooth. 5  Spoon into the well on the top of each cupcake.