refactor for rubocop