Move code to determine the number of arguments in a function to a dedicated ``get_num_args`` function.
Make use of urlunparse to construct URLs
Simplify the ``web_profile_dialog`` option