Replace treemap with hashmap