Preheat oven to 350 degrees. Line cupcake pans with paper liners if desired.
Combine all dry ingredients in a large mixing bowl. Mix at low speed for 30 seconds, scraping bowl constantly while mixing. Mix at high speed for 3 minutes, scraping bowl every minute.
Pour batter into cupcake liners until they are 1/2 to 2/3 full.
Bake for 20 to 25 minutes or until toothpick inserted in center comes out clean.
Cool 10 minutes in pans then move to wire rack to cool completely.
Have the cream cheese cold and the butter at room temperature. In a medium bowl, beat cream cheese, butter, and vanilla until blended. Add sugar one-third at a time and beat just until smooth and the desired consistency. If frosting is too stiff, beat for few seconds longer. Do not overbeat.