Fix rubocop offenses (skipping 1 offense for excessive block nesting)