edit code (according to rubocop suggestions)