Refactored, and cleaned up promises
Refactored, and cleaned up promises