diff --git a/gui/qml/logic.js b/gui/qml/logic.js
index 4fdbb995231893f56e7ded6bfae4bcf58288ae69..582b82490ee0bbe278aae3245221a046a3743863 100644
--- a/gui/qml/logic.js
+++ b/gui/qml/logic.js
@@ -34,6 +34,35 @@ function toHuman(st) {
     case "failed":
         //: %1 -> application name
         return qsTr("%1 blocking internet").arg(
-                    ctx.appName) // TODO failed is not handed yet
+                    ctx.appName) // TODO failed is not handled yet
     }
 }
+
+// Helper to show notification messages
+function showNotification(ctx, msg) {
+    console.log("Going to show notification message: ", msg)
+    if (supportsMessages) {
+        let appname = ctx ? ctx.appName : "VPN"
+        showMessage(appname, msg, null, 15000)
+    } else {
+        console.log("System doesn't support systray notifications")
+    }
+}
+
+function shouldAllowEmptyPass(providers) {
+    let obj = JSON.parse(providers.getJson())
+    let active = obj['default']
+    let allProviders = obj['providers']
+    for (var i = 0; i < allProviders.length; i++) {
+        if (allProviders[i]['name'] === active) {
+            return (allProviders[i]['authEmptyPass'] === 'true')
+        }
+    }
+    return false
+}
+
+function debugInit() {
+    console.debug("Platform:", Qt.platform.os)
+    console.debug("DEBUG: Pre-seeded providers:")
+    console.debug(providers.getJson())
+}
diff --git a/gui/qml/main.qml b/gui/qml/main.qml
index cef33443a8742c5ce829c6d62ee6d56109d51939..daffda221fa6da97eb591134f9808f5b52ec8077 100644
--- a/gui/qml/main.qml
+++ b/gui/qml/main.qml
@@ -241,18 +241,6 @@ ApplicationWindow {
         initFailure.visible = true
     }
 
-    function shouldAllowEmptyPass() {
-        let obj = JSON.parse(providers.getJson())
-        let active = obj['default']
-        let allProviders = obj['providers']
-        for (var i = 0; i < allProviders.length; i++) {
-            if (allProviders[i]['name'] === active) {
-                return (allProviders[i]['authEmptyPass'] === 'true')
-            }
-        }
-        return false
-    }
-
     function isManualLocation() {
         if (!ctx) {
             return false
@@ -264,7 +252,6 @@ ApplicationWindow {
         if (!ctx.currentLocation) {
             return
         }
-
         const location = ctx.currentLocation.toLowerCase()
         const idx = gwSelector.model.indexOf(location)
         gwSelector.currentIndex = idx
@@ -272,13 +259,10 @@ ApplicationWindow {
     }
 
     Component.onCompleted: {
+        Logic.debugInit()
         loginDone = false
-        console.debug("Platform:", Qt.platform.os)
-        console.debug("DEBUG: Pre-seeded providers:")
-        console.debug(providers.getJson())
-        allowEmptyPass = shouldAllowEmptyPass()
+        allowEmptyPass = Logic.shouldAllowEmptyPass(providers)
         needsRestart = false;
-
         /* TODO get appVisible flag from backend */
         app.visible = true
         app.raise()
@@ -441,24 +425,13 @@ ApplicationWindow {
                 console.log("show systray")
                 if (Qt.platform.os === "windows") {
                     let appname = ctx ? ctx.appName : "VPN"
-                    showNotification(
-                                appname
-                                + " is up and running. Please use system tray icon to control it.")
+                    Logic.showNotification(
+                        ctx,
+                        appname
+                        + " is up and running. Please use system tray icon to control it.")
                 }
             }
         }
-
-        // TODO move to logic, pass ctx
-        // Helper to show notification messages
-        function showNotification(msg) {
-            console.log("Going to show notification message: ", msg)
-            if (supportsMessages) {
-                let appname = ctx ? ctx.appName : "VPN"
-                showMessage(appname, msg, null, 15000)
-            } else {
-                console.log("System doesn't support systray notifications")
-            }
-        }
     }
 
     DonateDialog {