Refactored to use Hash class.
Refactored with initializer parameter.