refactored how hash was stored