refactor resolver