Promise refactor