refactored hash usage