Move callbacks to top of index.js