Ugly refactor for URL