Refactored the generic implementation of HashTable