refactor url string-munging to client ns