slight clean up in url function