test url_respolve method and refactor