diff --git a/app/lib/actions/foreman_template_tasks/template_action.rb b/app/lib/actions/foreman_template_tasks/template_action.rb
index 5a768bd486449278242d831f112ff5346f174232..8594f2f743fc3e4b950bb9ea6ffda998e86a6036 100644
--- a/app/lib/actions/foreman_template_tasks/template_action.rb
+++ b/app/lib/actions/foreman_template_tasks/template_action.rb
@@ -47,18 +47,18 @@ module Actions
         out += if changes.any?
                  "#{changes.count} templates changed"
                else
-                 location = self.class == TemplateImportAction ? 'local' : 'remote'
+                 location = is_a?(TemplateImportAction) ? 'local' : 'remote'
                  "no changes to #{location} templates"
                end
 
         out += if exceptions.any?
-                 ", #{output[:results].reject { |r| r[:exception].nil? }.count} templates skipped;\n- " + exceptions.join("\n- ")
+                 ", #{output[:results].count { |r| !r[:exception].nil? }} templates skipped;\n- " + exceptions.join("\n- ")
                else
                  '.'
                end
 
         if changes.any?
-          out += "\n\nTemplates changed:\n- " + changes.map { |ch| "#{ch[:type].camelcase} | #{ch[:name]}" }.join("\n- ")
+          out += "\n\nTemplates changed:\n- #{changes.map { |ch| "#{ch[:type].camelcase} | #{ch[:name]}" }.join("\n- ")}"
         end
 
         out