Switch from arraylist to hashmap