Refactored reduce out of resolve