Merged Ritesh's changes for converting hashes to models