minor promise refactoring