Increased performance using Set.filter