introduce interface to abstract array and hashmap away