Refactor address searching