def recursive_replace_val_str(obj, string, new_string, callback_on_replaced=None):
    """Recursively replace value strings in a nested dict/list `obj`.
    Replaces `string` value with `new_string`.
    If `callback_on_replaced` is not None, then call it on a replaced full string.
    """
    if isinstance(obj, list):
        obj = [
            recursive_replace_val_str(x, string, new_string, callback_on_replaced)
            for x in obj
        ]
    elif isinstance(obj, dict):
        for k in obj.keys():
            obj[k] = recursive_replace_val_str(
                obj[k], string, new_string, callback_on_replaced
            )
    elif isinstance(obj, str):
        if string in obj:
            obj = obj.replace(string, new_string)
            if callback_on_replaced:
                callback_on_replaced(obj)

    return obj