refactored promises