moving parse_url function to db command