Refactored from jQuery promises to ES6 Promises