rewrite API to directly work with url.URL instead of strings