diff --git a/Changelog.md b/Changelog.md
index 8a37518bac61e2226d02b13ac0ec0b259ec5564e..75bc9ddb45203ad4d1586d8c8ee5358a7402e28a 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -70,6 +70,7 @@ With the port to Bootstrap 3, app/views/terms/default.haml has a new structure.
 * Drop outdated/unused mbp-respond.min.js and mbp-modernizr-custom.js [#6257](https://github.com/diaspora/diaspora/pull/6257)
 * Refactor ApplicationController#after\_sign\_out\_path\_for [#6258](https://github.com/diaspora/diaspora/pull/6258)
 * Extract StatusMessageService from StatusMessagesController [#6280](https://github.com/diaspora/diaspora/pull/6280)
+* Refactor HomeController#toggle\_mobile [#6260](https://github.com/diaspora/diaspora/pull/6260)
 
 ## Bug fixes
 * Fix indentation and a link title on the default home page [#6212](https://github.com/diaspora/diaspora/pull/6212)
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index a1803c231aa0d0075d967b0c4933a0b4ea3e7d52..d013c72f225256708d66e7db20dda2366a11339f 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -26,13 +26,7 @@ class HomeController < ApplicationController
   end
 
   def toggle_mobile
-    if session[:mobile_view].nil?
-      # we're most probably not on mobile, but user wants it anyway
-      session[:mobile_view] = true
-    else
-      # switch from mobile to normal html
-      session[:mobile_view] = !session[:mobile_view]
-    end
+    session[:mobile_view] = session[:mobile_view].nil? ? true : !session[:mobile_view]
 
     redirect_to :back
   end