Refactor hashmap.