Refactor hash in hash