Improve hashmap impl.
Intermediate commit.