more refactoring get_url