Rubocop-inspired refactor