Update to use HashMap::entry API