def remove_element_types(lattice, types=['stop', 'comment', 'write_beam', 'wakefield']):
    """
    Removes particular types of elements from a lattice (list of elements)
    """

    return [ele for ele in lattice if ele['type'] not in types]