def rename_categories(old_to_new_map, data):
    """
    Rename categories in task files
    
    Args:
        `old_to_new_map` should look like 
        {
            "old category name 1": "new category name 1",
            "old category name 2": "new category name 2"
        }
    """
    for i, category in enumerate(data["Categories"]):
        if category in old_to_new_map:
            data["Categories"][i] = old_to_new_map[category]
    return data