simplified code around "get_next_url"