refactor create hash