Rubocop refactoring