refactor, better resolver