Refactoring HashMap to generic interface Map. Other minor changes.
Generalization of types value in Map.