diff --git a/src/app/MainApplicationWindow.qml b/src/app/MainApplicationWindow.qml
index 2b78a8969e064da9f8806f04bc19a878c665347f..b8f10e34d378bdebcfa0cdc223ba86b147bb0290 100644
--- a/src/app/MainApplicationWindow.qml
+++ b/src/app/MainApplicationWindow.qml
@@ -72,14 +72,29 @@ ApplicationWindow {
 
     function startClient() {
         if (UtilsAdapter.getAccountListSize() !== 0) {
-            mainApplicationLoader.setSource(JamiQmlUtils.mainViewLoadPath)
+            setMainLoaderSource(JamiQmlUtils.mainViewLoadPath)
         } else {
-            mainApplicationLoader.setSource(JamiQmlUtils.wizardViewLoadPath)
+            setMainLoaderSource(JamiQmlUtils.wizardViewLoadPath)
         }
     }
 
     function startAccountMigration() {
-        mainApplicationLoader.setSource(JamiQmlUtils.accountMigrationViewLoadPath)
+        setMainLoaderSource(JamiQmlUtils.accountMigrationViewLoadPath)
+    }
+
+    function setMainLoaderSource(source) {
+        if (checkLoadedSource() === MainApplicationWindow.LoadedSource.MainView) {
+            cleanupMainView()
+        }
+        mainApplicationLoader.setSource(source)
+    }
+
+    function cleanupMainView() {
+        // Save the main view window size if loading anything else.
+        layoutManager.saveWindowSettings()
+
+        // Unload any created views used by the main view.
+        viewCoordinator.deinit()
     }
 
     function close(force = false) {
@@ -87,9 +102,9 @@ ApplicationWindow {
         // is set, then we can quit
         if (force || !UtilsAdapter.getAppValue(Settings.MinimizeOnClose) ||
                 !UtilsAdapter.getAccountListSize()) {
-            // Save the window geometry and state before quitting.
-            layoutManager.saveWindowSettings()
-            viewCoordinator.deinit()
+            if (checkLoadedSource() === MainApplicationWindow.LoadedSource.MainView) {
+                cleanupMainView()
+            }
             Qt.quit()
         } else {
             layoutManager.closeToTray()
@@ -123,7 +138,7 @@ ApplicationWindow {
             target: viewCoordinator
 
             function onRequestAppWindowWizardView() {
-                mainApplicationLoader.setSource(JamiQmlUtils.wizardViewLoadPath)
+                setMainLoaderSource(JamiQmlUtils.wizardViewLoadPath)
             }
         }
 
@@ -132,9 +147,9 @@ ApplicationWindow {
 
             function onLoaderSourceChangeRequested(sourceToLoad) {
                 if (sourceToLoad === MainApplicationWindow.LoadedSource.WizardView)
-                    mainApplicationLoader.setSource(JamiQmlUtils.wizardViewLoadPath)
+                    setMainLoaderSource(JamiQmlUtils.wizardViewLoadPath)
                 else
-                    mainApplicationLoader.setSource(JamiQmlUtils.mainViewLoadPath)
+                    setMainLoaderSource(JamiQmlUtils.mainViewLoadPath)
             }
         }
 
@@ -144,9 +159,7 @@ ApplicationWindow {
         onLoaded: {
             if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView) {
                 // Onboarding wizard window, these settings are fixed.
-                // - window screen should default to the primary
-                // - position should default to being centered based on the
-                //   following dimensions
+                // - window screen will default to the primary
                 // - the window will showNormal once windowSettingsLoaded is
                 //   set to true(then forcing visible to true)
                 appWindow.width = JamiTheme.wizardViewMinWidth
diff --git a/src/app/ViewCoordinator.qml b/src/app/ViewCoordinator.qml
index 76f3034efed01789da1f97a9a2bc05eaa3a616df..c4c9148d8b8262b9eef8dc0aee67d050abc613f4 100644
--- a/src/app/ViewCoordinator.qml
+++ b/src/app/ViewCoordinator.qml
@@ -46,18 +46,19 @@ QtObject {
     // The `main` view of the application window.
     property StackView rootView
 
-    property var currentViewName: rootView && rootView.currentItem.objectName || null
+    property var currentViewName: rootView && rootView.currentItem &&
+                                      rootView.currentItem.objectName || null
 
-    function init(appWindow) {
+    function init(mainStackView) {
         rootView = Qt.createQmlObject(`import QtQuick; import QtQuick.Controls
                                       StackView { anchors.fill: parent }`,
-                                      appWindow)
+                                      mainStackView)
         initialized()
     }
 
     function deinit() {
         viewManager.destroyAllViews()
-        rootView.destroy()
+        if (rootView) rootView.destroy()
     }
 
     // Finds a view and gets its index within the StackView it's in.
@@ -120,8 +121,8 @@ QtObject {
 
     // Dismiss by object.
     function dismissObj(obj) {
-        if (obj.StackView.view !== rootView) {
-            print("view not in the stack:", obj)
+        // Check if it makes sense to remove this view at all.
+        if (obj.StackView.view !== rootView || !viewManager.viewCount()) {
             return
         }
 
diff --git a/src/app/ViewManager.qml b/src/app/ViewManager.qml
index 3cf03d6cf0a5884865bff28880af644775abf6b3..310af0e94756c5e3a08fc1c4ed224c2ca367ef37 100644
--- a/src/app/ViewManager.qml
+++ b/src/app/ViewManager.qml
@@ -24,8 +24,11 @@ QtObject {
     property variant views: ({})
     // A map of view names to path strings.
     property variant viewPaths: ({})
-    // The number of views.
-    property int nViews: 0
+
+    // The number of views loaded (`views` is only resized).
+    function viewCount() {
+        return Object.keys(views).length
+    }
 
     // Destroy all views.
     function destroyAllViews() {
@@ -35,7 +38,7 @@ QtObject {
     }
 
     function createView(path, parent=null, cb=null, props={}) {
-        if (views[path] !== undefined) {
+        if (views.hasOwnProperty(path)) {
             // an instance of <path> already exists
             if (cb !== null) {
                 cb(views[path])
@@ -56,7 +59,6 @@ QtObject {
                         obj.objectName :
                         path.replace(/^.*[\\\/]/, '').replace(/\.[^/.]+$/, "")
             viewPaths[viewName] = path
-            nViews = Object.keys(views).length
             if (cb !== null) {
                 cb(obj)
             }
@@ -69,32 +71,22 @@ QtObject {
     }
 
     function destroyView(path) {
-        if (views[path] === undefined) {
-            print(path, "instance does not exist", Object.keys(views))
+        // The view may already have been destroyed.
+        if (!views.hasOwnProperty(path)) {
             return false
         }
         views[path].destroy()
-        views[path] = undefined
-        // QObject::destroy is queued, and we can't connect to its completion,
-        // so we queue the resulting mutation to our view storage.
-        Qt.callLater(function() {
-            delete views[path]
-            // Remove the view name from the viewPaths map.
-            for (var viewName in viewPaths) {
-                if (viewPaths[viewName] === path) {
-                    delete viewPaths[viewName]
-                    break
-                }
+        delete views[path]
+        // Remove the view name from the viewPaths map.
+        for (var viewName in viewPaths) {
+            if (viewPaths[viewName] === path) {
+                delete viewPaths[viewName]
+                break
             }
-            nViews = Object.keys(views).length
-        })
+        }
         return true
     }
 
-    function hasView(viewName) {
-        return nViews && viewPaths[viewName] !== undefined
-    }
-
     function getView(viewName) {
         return views[viewPaths[viewName]] || null
     }
diff --git a/src/app/accountadapter.cpp b/src/app/accountadapter.cpp
index 74eb9210058bfbaeefc3f4fe7c319b26c59afba7..a60446ad335c8c4b9b6c146cf00decf613b3d1d8 100644
--- a/src/app/accountadapter.cpp
+++ b/src/app/accountadapter.cpp
@@ -257,12 +257,10 @@ AccountAdapter::deleteCurrentAccount()
                           &lrc::api::AccountModel::accountRemoved,
                           [this](const QString& accountId) {
                               Q_UNUSED(accountId);
-                              // For testing purpose
-                              Q_EMIT accountRemoved();
+                              Q_EMIT lrcInstance_->accountListChanged();
                           });
 
     lrcInstance_->accountModel().removeAccount(lrcInstance_->get_currentAccountId());
-    Q_EMIT lrcInstance_->accountListChanged();
 }
 
 bool
diff --git a/src/app/accountadapter.h b/src/app/accountadapter.h
index 8b474941677dcf80ee1b8b781e89345bdd9bb43d..7ecfa9442fe251c5769787dbdfee1c8d4f76f38e 100644
--- a/src/app/accountadapter.h
+++ b/src/app/accountadapter.h
@@ -88,7 +88,6 @@ Q_SIGNALS:
     void reportFailure();
     void accountCreationFailed();
     void accountAdded(QString accountId, int index);
-    void accountRemoved();
     void accountConfigFinalized();
 
 private:
diff --git a/src/app/mainview/components/SidePanel.qml b/src/app/mainview/components/SidePanel.qml
index d5eeb0590373e0bac5184598e4420e10b4ea75a4..768a363728dd49d6cdc7ff501b9b508a24314fb4 100644
--- a/src/app/mainview/components/SidePanel.qml
+++ b/src/app/mainview/components/SidePanel.qml
@@ -241,13 +241,13 @@ SidePanelBase {
                 anchors.right: parent.right
                 anchors.rightMargin: 15
 
-                    Shortcut {
-                        sequence: "Ctrl+F"
-                        context: Qt.ApplicationShortcut
-                        onActivated: {
-                            contactSearchBar.forceActiveFocus()
-                        }
+                Shortcut {
+                    sequence: "Ctrl+F"
+                    context: Qt.ApplicationShortcut
+                    onActivated: {
+                        contactSearchBar.forceActiveFocus()
                     }
+                }
 
                 ContactSearchBar {
                     id: contactSearchBar
diff --git a/src/app/settingsview/SettingsView.qml b/src/app/settingsview/SettingsView.qml
index c50760abcaa094521faae065fa196a072c41b815..2ba325b31d092c6ce2965b5f7fe238d5fbbd1c5b 100644
--- a/src/app/settingsview/SettingsView.qml
+++ b/src/app/settingsview/SettingsView.qml
@@ -47,6 +47,7 @@ ListSelectionView {
 
     onDismissed: {
         // Trigger an update to messages if needed.
+        // Currently needed when changing the show link preview setting.
         CurrentConversation.reloadInteractions()
         settingsViewRect.stopBooth()
         if (UtilsAdapter.getAccountListSize() === 0) {
@@ -168,7 +169,15 @@ ListSelectionView {
                     isSIP: settingsViewRect.isSIP
 
                     onNavigateToMainView: dismiss()
-                    onNavigateToNewWizardView: dismiss()
+                    Connections {
+                        target: LRCInstance
+
+                        function onAccountListChanged() {
+                            if (!UtilsAdapter.getAccountListSize()) {
+                                viewCoordinator.requestAppWindowWizardView()
+                            }
+                        }
+                    }
 
                     onAdvancedSettingsToggled: function (settingsVisible) {
                         if (settingsVisible)
diff --git a/src/app/settingsview/components/CurrentAccountSettings.qml b/src/app/settingsview/components/CurrentAccountSettings.qml
index bfea23ea0436a8ad5c0a1b35316201e0d1818f7f..4ced54f4505437e379e060188fdd23fcbcaef230 100644
--- a/src/app/settingsview/components/CurrentAccountSettings.qml
+++ b/src/app/settingsview/components/CurrentAccountSettings.qml
@@ -37,7 +37,6 @@ Rectangle {
     property int preferredColumnWidth : Math.min(root.width / 2 - 50, 350)
 
     signal navigateToMainView
-    signal navigateToNewWizardView
     signal advancedSettingsToggled(bool settingsVisible)
 
     function updateAccountInfoDisplayed() {