diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index c689eac..5790f3d 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -1509,39 +1509,35 @@ accounts_dialog_treeview_button_press_event_cb (GtkTreeView *view,
   GtkWidget *menu;
   GtkWidget *item_enable, *item_disable;
   GtkWidget *image_enable, *image_disable;
-  guint presence;
-  const gchar* icon_name;
 
   /* ignore multiple clicks */
   if (event->type != GDK_BUTTON_PRESS)
     return TRUE;
 
   if (event->button != 3)
-    return FALSE;
+    goto out;
 
   /* Selection is not yet set, so we have to get account from event position */
   model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview));
   if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (priv->treeview),
       event->x, event->y, &path, NULL, NULL, NULL))
-    return FALSE;
+    goto out;
   if (!gtk_tree_model_get_iter (model, &iter, path))
-    {
-      gtk_tree_path_free (path);
-      return FALSE;
-    }
+    goto out;
+
   gtk_tree_model_get (model, &iter, COL_ACCOUNT, &account, -1);
 
   /* Create the menu */
   menu = gtk_menu_new ();
 
   /* Get images for menu items */
-  presence = tp_account_manager_get_most_available_presence
-      (priv->account_manager, NULL, NULL);
-  icon_name = empathy_icon_name_for_presence (presence);
-  image_enable = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
-  image_disable = gtk_image_new_from_icon_name
-      (empathy_icon_name_for_presence ( TP_CONNECTION_PRESENCE_TYPE_OFFLINE),
-          GTK_ICON_SIZE_MENU);
+  image_enable = gtk_image_new_from_icon_name (empathy_icon_name_for_presence (
+        tp_account_manager_get_most_available_presence (
+          priv->account_manager, NULL, NULL)),
+      GTK_ICON_SIZE_MENU);
+  image_disable = gtk_image_new_from_icon_name (
+      empathy_icon_name_for_presence (TP_CONNECTION_PRESENCE_TYPE_OFFLINE),
+      GTK_ICON_SIZE_MENU);
 
   /* Menu items: to enabled/disable the account */
   item_enable = gtk_image_menu_item_new_with_mnemonic (_("_Enable"));
@@ -1554,18 +1550,17 @@ accounts_dialog_treeview_button_press_event_cb (GtkTreeView *view,
 
   if (tp_account_is_enabled (account))
     {
-      g_signal_connect_data (item_disable, "activate",
-          G_CALLBACK (accounts_dialog_treeview_enabled_cb),
-          g_object_ref (account), (GClosureNotify) g_object_unref, 0);
+      tp_g_signal_connect_object (item_disable, "activate",
+          G_CALLBACK (accounts_dialog_treeview_enabled_cb), account, 0);
       gtk_widget_set_sensitive (item_enable, FALSE);
     }
   else
     {
-      g_signal_connect_data (item_enable, "activate",
-          G_CALLBACK (accounts_dialog_treeview_enabled_cb),
-          g_object_ref (account), (GClosureNotify) g_object_unref, 0);
+      tp_g_signal_connect_object (item_enable, "activate",
+          G_CALLBACK (accounts_dialog_treeview_enabled_cb), account, 0);
       gtk_widget_set_sensitive (item_disable, FALSE);
     }
+
   gtk_widget_show (item_enable);
   gtk_widget_show (item_disable);
 
@@ -1575,7 +1570,8 @@ accounts_dialog_treeview_button_press_event_cb (GtkTreeView *view,
   gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
       event->button, event->time);
 
-  g_object_unref (account);
+out:
+  tp_clear_object (&account);
   gtk_tree_path_free (path);
 
   return FALSE;
