refactored promise
further refactoring of promise