Micro optimization.
Tweaked the promise based version a bit.