Change to using promises instead of callbacks.