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 Beat in the eggs, one at a time, then stir in the vanilla. 2  Combine flour and baking powder, add to the creamed mixture and mix well. 3  Finally stir in the milk until batter is smooth. 4  Pour or spoon batter into the prepared pan. 5  Bake for 30 to 40 minutes in the preheated oven. 6  For cupcakes, bake 20 to 25 minutes. Pour or spoon batter into the prepared pan. 2  Bake for 30 to 40 minutes in the preheated oven. 3  For cupcakes, bake 20 to 25 minutes. 4  Cake is done when it springs back to the touch.