replace LinkedHashSet and TreeSet