Test url resolve method and refactor