def diff_dict(old, new):
    """
    Compare two dicts and create dict (set_) with new or changed values/keys or
    a list (remove_) of missing keys.
    """
    set_ = {}
    remove_ = []

    for k in new.keys():
        if k in old:  # key exists in both
            if new[k] != old[k]:  # but the value changed
                set_[k] = new[k]
        else:  # something new appeared in new dict
            set_[k] = new[k]

    for k in old.keys():
        if k not in new:  # key from old which was not found in new
            remove_.append(k)  # the remove array is a list of identifiers

    return set_, remove_