Add futures to package.json.
Refactor the control flow with Futures.