change logic pattern for rubocop