A few matter of taste changes of how promises are returned and variables defined

No functional difference! Except perhaps for steppier debugging.
Refactor query to be easier on the eyes