Refractored towards HashMap