diff --git a/src/screenshot-application.c b/src/screenshot-application.c
index ee949d3..f6919ec 100644
--- a/src/screenshot-application.c
+++ b/src/screenshot-application.c
@@ -49,6 +49,7 @@ static void screenshot_application_startup (GApplication *app);
 static void screenshot_back (ScreenshotApplication *self);
 static void screenshot_save_to_file (ScreenshotApplication *self);
 static void screenshot_show_interactive_dialog (ScreenshotApplication *self);
+static void screenshot_close_interactive_dialog (ScreenshotApplication *self);
 static void screenshot_start (ScreenshotApplication *self);
 
 struct _ScreenshotApplicationPriv {
@@ -116,11 +117,7 @@ save_pixbuf_handle_success (ScreenshotApplication *self)
 
   if (screenshot_config->interactive)
     {
-      ScreenshotDialog *dialog = self->priv->dialog;
-
-      save_folder_to_settings (self);
-      gtk_widget_destroy (dialog->dialog);
-      g_free (dialog);
+      screenshot_close_interactive_dialog (self);
     }
   else
     {
@@ -400,10 +397,7 @@ screenshot_save_to_file (ScreenshotApplication *self)
 static void
 screenshot_back (ScreenshotApplication *self)
 {
-  ScreenshotDialog *dialog = self->priv->dialog;
-  save_folder_to_settings (self);
-  gtk_widget_destroy (dialog->dialog);
-  g_free (dialog);
+  screenshot_close_interactive_dialog (self);
   screenshot_show_interactive_dialog (self);
 }
 
@@ -433,7 +427,7 @@ screenshot_dialog_response_cb (ScreenshotResponse response,
       screenshot_save_to_clipboard (self);
       break;
     case SCREENSHOT_RESPONSE_BACK:
-      screenshot_back(self);
+      screenshot_back (self);
       break;
     default:
       g_assert_not_reached ();
@@ -748,6 +742,15 @@ screenshot_show_interactive_dialog (ScreenshotApplication *self)
 }
 
 static void
+screenshot_close_interactive_dialog (ScreenshotApplication *self)
+{
+  ScreenshotDialog *dialog = self->priv->dialog;
+  save_folder_to_settings (self);
+  gtk_widget_destroy (dialog->dialog);
+  g_free (dialog);
+}
+
+static void
 action_quit (GSimpleAction *action,
              GVariant *parameter,
              gpointer user_data)
@@ -916,6 +919,7 @@ screenshot_application_init (ScreenshotApplication *self)
   g_application_add_main_option_entries (G_APPLICATION (self), entries);
 }
 
+
 ScreenshotApplication *
 screenshot_application_new (void)
 {
diff --git a/src/screenshot-dialog.c b/src/screenshot-dialog.c
index 65c3b58..0e9e56a 100644
--- a/src/screenshot-dialog.c
+++ b/src/screenshot-dialog.c
@@ -148,7 +148,6 @@ button_clicked (GtkWidget *button, ScreenshotDialog *dialog)
       res = SCREENSHOT_RESPONSE_COPY;
   else
       res = SCREENSHOT_RESPONSE_BACK;
-      
 
   dialog->callback (res, dialog->user_data);
 }
