Refactoring & implementing Hash