Refactoring to make rubocop slightly more happy, should work for nested has and array structures in ruby