refactoring
promises are executed sequentially