Changed code to use central hashmap