refactoring out into a Connection class and a Url class