Cleaning up the building of URLs