Refactor rubocop