Actully it was not. In fact it was inferior carriers and carrier operations that made the difference.
If you want to know about Midway, not the regurgitated writings of the Japaneese officer, read Shattered Sword by Parshal and Tulley. It is a minute by minute recounting of the battle.
http://www.amazon.com/s/ref=nb_sb_ss_i_1_15?url=search-alias%3Daps&field-keywords=shattered%20sword%20the%20untold%20story%20of%20the%20battle%20of%20midway&sprefix=shattered+sword%2Caps%2C138
Exactly, we had better technology and the ability to turn out better planes once we identified weaknesses. Also, never underestimate the will of the American people, well the people of that era who were proud to be Americans and not self-absorbed and apologetic for our successes.