         self.appViewController = appViewController
         self.router = router
     }
-    
-    
-    @objc(routeURL:completion:)
-    public func route(_ url: URL, completion: @escaping () -> Void) -> Bool {
+
+    private func presentOrPush(_ viewController: UIViewController, with completion: @escaping () -> Void) -> Bool {
         guard let navigationController = appViewController.currentNavigationController else {
             completion()
             return false
         }
+
+        if let presented = navigationController.presentedViewController {
+            let wrapper = WMFThemeableNavigationController(rootViewController: viewController, theme:appViewController.theme, style: .gallery)
+            presented.present(wrapper, animated: true, completion: completion)
+        } else {
+            navigationController.pushViewController(viewController, animated: true)
+            completion()
+        }
         
+        return true
+    }
+    
+    @objc(routeURL:completion:)
+    public func route(_ url: URL, completion: @escaping () -> Void) -> Bool {
         let theme = appViewController.theme
-        
-        let present = { (viewController: UIViewController) in
-            defer {
-                completion()
-            }
-            if let presented = navigationController.presentedViewController {
-                let wrapper = WMFThemeableNavigationController(rootViewController: viewController, theme:theme, style: .gallery)
-                presented.present(wrapper, animated: true)
-            } else {
-                navigationController.pushViewController(viewController, animated: true)
-            }
-        }
-
         do {
             let destination = try router.destination(for: url)
             switch destination {

                return true
            case .articleHistory(let linkURL, let articleTitle):
                let pageHistoryVC = PageHistoryViewController(pageTitle: articleTitle, pageURL: linkURL)
                present(pageHistoryVC)
                return true
            case .articleDiffCompare(let linkURL, let fromRevID, let toRevID):
                guard let siteURL = linkURL.wmf_site,
                  (fromRevID != nil || toRevID != nil) else {

                    return false
                }
                let diffContainerVC = DiffContainerViewController(siteURL: siteURL, theme: theme, fromRevisionID: fromRevID, toRevisionID: toRevID, type: .single, articleTitle: nil, hidesHistoryBackTitle: true)
                return presentOrPush(diffContainerVC, with: completion)
            case .inAppLink(let linkURL):
                let singlePageVC = SinglePageWebViewController(url: linkURL, theme: theme)
                return presentOrPush(singlePageVC, with: completion)
            case .userTalk(let linkURL):
                guard let talkPageVC = TalkPageContainerViewController.userTalkPageContainer(url: linkURL, dataStore: appViewController.dataStore, theme: theme) else {
                    completion()
                    return false
                }
                return presentOrPush(talkPageVC, with: completion)
            default:
                completion()
                return false
