Refactored resolve method