refactor address resolution to helper func