makes appropriate changes for the shift from callbacks to promises