enhancing get_url_params and adding a function to reverse the logic