use urlparse instead of string formatting