using Set instead of Iterable for convenience