Helper functions for ES6 promises