Replace ArrayList with HashSet