refactor resolution code for clarity