More refactoring for adding to hash method