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.
Reduce the bake time listed in your cake recipe to the correct amount of time based on the particular size of your muffin pan. You don't need an elaborate mathematical formula to convert bake times for a muffin pan. Instead of starting with the time listed in your recipe, use your pan size as a handy guide. Bake muffins or cupcakes in mini muffin pans for eight to 10 minutes. Place one heaping tablespoon of batter in the pan for each muffin. This size of a pan yields about five dozen muffins or cupcakes.