Index: /trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp	(revision 86664)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp	(revision 86665)
@@ -718,8 +718,5 @@
 {
     /* Search for profile node: */
-    const QString strProfileNodeName = QString("/%1/%2").arg(strProviderShortName, strProfileName);
-    QList<UIChooserNode*> profileNodes;
-    invisibleRoot()->searchForNodes(strProfileNodeName, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes);
-    UIChooserNode *pProfileNode = profileNodes.value(0);
+    UIChooserNode *pProfileNode = searchProfileNode(strProviderShortName, strProfileName);
     if (!pProfileNode)
         return;
@@ -738,8 +735,5 @@
 {
     /* Search for profile node: */
-    const QString strProfileNodeName = QString("/%1/%2").arg(strProviderShortName, strProfileName);
-    QList<UIChooserNode*> profileNodes;
-    invisibleRoot()->searchForNodes(strProfileNodeName, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes);
-    UIChooserNode *pProfileNode = profileNodes.value(0);
+    UIChooserNode *pProfileNode = searchProfileNode(strProviderShortName, strProfileName);
     if (!pProfileNode)
         return;
@@ -759,19 +753,14 @@
 {
     /* Search for profile node: */
-    const QString strProfileNodeName = QString("/%1/%2").arg(strProviderShortName, strProfileName);
-    QList<UIChooserNode*> profileNodes;
-    invisibleRoot()->searchForNodes(strProfileNodeName, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes);
-    UIChooserNode *pProfileNode = profileNodes.value(0);
+    UIChooserNode *pProfileNode = searchProfileNode(strProviderShortName, strProfileName);
     if (!pProfileNode)
         return;
 
     /* Add new machine-item: */
-    addCloudMachineIntoTheTree(strProfileNodeName, comMachine, true /* make it visible? */);
-
-    /* Search for possible fake node: */
-    QList<UIChooserNode*> fakeNodes;
-    pProfileNode->searchForNodes(QUuid().toString(), UIChooserItemSearchFlag_Machine | UIChooserItemSearchFlag_ExactId, fakeNodes);
+    const QString strGroup = QString("/%1/%2").arg(strProviderShortName, strProfileName);
+    addCloudMachineIntoTheTree(strGroup, comMachine, true /* make it visible? */);
+
     /* Delete fake node if present: */
-    delete fakeNodes.value(0);
+    delete searchFakeNode(pProfileNode);
 }
 
@@ -781,20 +770,15 @@
 {
     /* Search for profile node: */
-    const QString strProfileNodeName = QString("/%1/%2").arg(strProviderShortName, strProfileName);
-    QList<UIChooserNode*> profileNodes;
-    invisibleRoot()->searchForNodes(strProfileNodeName, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes);
-    UIChooserNode *pProfileNode = profileNodes.value(0);
+    UIChooserNode *pProfileNode = searchProfileNode(strProviderShortName, strProfileName);
     if (!pProfileNode)
         return;
 
     /* Add new machine-items: */
+    const QString strGroup = QString("/%1/%2").arg(strProviderShortName, strProfileName);
     foreach (const CCloudMachine &comMachine, machines)
-        addCloudMachineIntoTheTree(strProfileNodeName, comMachine, false /* make it visible? */);
-
-    /* Search for possible fake node: */
-    QList<UIChooserNode*> fakeNodes;
-    pProfileNode->searchForNodes(QUuid().toString(), UIChooserItemSearchFlag_Machine | UIChooserItemSearchFlag_ExactId, fakeNodes);
+        addCloudMachineIntoTheTree(strGroup, comMachine, false /* make it visible? */);
+
     /* Delete fake node if present: */
-    delete fakeNodes.value(0);
+    delete searchFakeNode(pProfileNode);
 }
 
@@ -807,10 +791,9 @@
     UITaskCloudListMachines *pAcquiringTask = qobject_cast<UITaskCloudListMachines*>(pTask);
     AssertPtrReturnVoid(pAcquiringTask);
+    const QString strProviderShortName = pAcquiringTask->providerShortName();
+    const QString strProfileName = pAcquiringTask->profileName();
 
     /* Search for profile node: */
-    const QString strProfileNodeName = QString("/%1/%2").arg(pAcquiringTask->providerShortName(), pAcquiringTask->profileName());
-    QList<UIChooserNode*> profileNodes;
-    invisibleRoot()->searchForNodes(strProfileNodeName, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes);
-    UIChooserNode *pProfileNode = profileNodes.value(0);
+    UIChooserNode *pProfileNode = searchProfileNode(strProviderShortName, strProfileName);
     if (!pProfileNode)
         return;
@@ -847,11 +830,11 @@
     /* Remove unregistered cloud VM nodes: */
     if (!unregisteredIDs.isEmpty())
-        sltCloudMachinesUnregistered(pAcquiringTask->providerShortName(), pAcquiringTask->profileName(), unregisteredIDs.toList());
+        sltCloudMachinesUnregistered(strProviderShortName, strProfileName, unregisteredIDs.toList());
     /* Add registered cloud VM nodes: */
     if (!registeredMachines.isEmpty())
-        sltCloudMachinesRegistered(pAcquiringTask->providerShortName(), pAcquiringTask->profileName(), registeredMachines);
+        sltCloudMachinesRegistered(strProviderShortName, strProfileName, registeredMachines);
 
     /* Remove cloud account key from the list of keys currently being updated: */
-    const UICloudAccountKey accountKey = qMakePair(pAcquiringTask->providerShortName(), pAcquiringTask->profileName());
+    const UICloudAccountKey accountKey = qMakePair(strProviderShortName, strProfileName);
     removeCloudAccountKey(accountKey);
 }
@@ -1619,4 +1602,27 @@
 }
 
+UIChooserNode *UIChooserAbstractModel::searchProfileNode(const QString &strProviderShortName, const QString &strProfileName)
+{
+    /* Compose profile node ID: */
+    const QString strProfileNodeId = QString("/%1/%2").arg(strProviderShortName, strProfileName);
+
+    /* Search for a list of nodes matching required ID: */
+    QList<UIChooserNode*> profileNodes;
+    invisibleRoot()->searchForNodes(strProfileNodeId, UIChooserItemSearchFlag_CloudProfile | UIChooserItemSearchFlag_ExactId, profileNodes);
+
+    /* Return 1st node if any: */
+    return profileNodes.value(0);
+}
+
+UIChooserNode *UIChooserAbstractModel::searchFakeNode(UIChooserNode *pProfileNode)
+{
+    /* Search for a list of nodes matching null ID: */
+    QList<UIChooserNode*> fakeNodes;
+    pProfileNode->searchForNodes(QUuid().toString(), UIChooserItemSearchFlag_Machine | UIChooserItemSearchFlag_ExactId, fakeNodes);
+
+    /* Return 1st node if any: */
+    return fakeNodes.value(0);
+}
+
 
 #include "UIChooserAbstractModel.moc"
Index: /trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h	(revision 86664)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.h	(revision 86665)
@@ -308,4 +308,12 @@
     /** @} */
 
+    /** @name Cloud stuff.
+      * @{ */
+        /** Searches for profile node with passed @a strProviderShortName and @a strProfileName. */
+        UIChooserNode *searchProfileNode(const QString &strProviderShortName, const QString &strProfileName);
+        /** Searches for fake node under passed @a pProfileNode. */
+        UIChooserNode *searchFakeNode(UIChooserNode *pProfileNode);
+    /** @} */
+
     /** @name General stuff.
       * @{ */
