Cleanup: Removed unused local variables, imports and private function. Supply explicit type parameters for HashMap creation.