def _change_dict_key(the_dict, old_key, new_key, default=None):
    """
    Changes a dictionary key name from old_key to new_key.
    If old_key doesn't exist the value of new_key becomes and empty dictionary
    (or the value of `default`, if set).
    """
    if default is None:
        default = dict()

    v = the_dict.get(old_key, default)
    if new_key not in the_dict:
        the_dict[new_key] = v
    if old_key in the_dict:
        del the_dict[old_key]

    return the_dict