Simplify using HashSet