Refactored hashmap