refactor: ruby hash