rubocop refactoring