List<T> removeElement<T>(Iterable<T>? elements, T toRemove) => elements?.where((item) => item != toRemove).toList() ?? [];