Generic Hashmap datastructure implementation