Move get_url() to util file