Use promises rather than home-cooked gibberish.