diff --git a/lib/gemsmith/generators/rspec.rb b/lib/gemsmith/generators/rspec.rb
index <HASH>..<HASH> 100644
--- a/lib/gemsmith/generators/rspec.rb
+++ b/lib/gemsmith/generators/rspec.rb
@@ -24,13 +24,14 @@ module Gemsmith
 
       def install_templates
         cli.template "#{rspec_root}/spec_helper.rb.tt", configuration
-
-        if configuration.dig(:generate, :rails)
-          cli.template("#{rspec_root}/rails_helper.rb.tt", configuration)
-        end
-
+        install_rails_helper
         cli.template "#{rspec_root}/support/shared_contexts/temp_dir.rb.tt", configuration
       end
+
+      def install_rails_helper
+        return unless configuration.dig(:generate, :rails)
+        cli.template("#{rspec_root}/rails_helper.rb.tt", configuration)
+      end
     end
   end
 end
Fixed Rubocop Style/MissingElse issues.