moved async code into promises with BrightFutures