Small tweak, using hashMap.containsKey() for conditional logic
Eliminated static references to instances