 
 @UIApplicationMain
 class AppDelegate: UIResponder, UIApplicationDelegate {
-
     fileprivate let router = Router()
 
     var window: UIWindow?
 
     fileprivate lazy var manager: Manager<WindowLevel> = Manager(mainWindow: self.window!)
-
-    private let disposeBag = DisposeBag()
-
+}
+
+extension AppDelegate {
     func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
         UNUserNotificationCenter.current().delegate = self
         return true
     }
-
+    
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
         // Override point for customization after application launch.
-
+        
         print(CommandLine.arguments)
         print(NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0])
-
+        
         setupWindow()
-
+        
         ErrorHandlingSettings.launch()
         RoutingSettings.launch()
-
+        
         setupiTunesMusic()
         setupPlayer()
-
+        
         window?.backgroundColor = .clear
         window?.tintColor = .lightGray
         window?.makeKey()
-
-
+        
+        
         print((iTunesRealm()).configuration.fileURL?.absoluteString ?? "")
         print((iTunesRealm()).schema.objectSchema.map { $0.className })
-
+        
         UNUserNotificationCenter.current().delegate = self
         UNUserNotificationCenter.current().requestAuthorization(options: [.badge, .sound, .alert]) { granted, error in
             if granted {
                 application.registerForRemoteNotifications()
             }
         }
-
+        
         return true
     }
-
+    
     private func setupWindow() {
         UIViewController.swizzle_setNeedsStatusBarAppearanceUpdate()
         manager[.background].rootViewController = PlaybackViewController()

        return false
    }
}

extension AppDelegate: UNUserNotificationCenterDelegate {


            fatalError()
        }
        UIApplication.shared.beginReceivingRemoteControlEvents()
        
        player.install(middleware: ControlCenter())
        //player.install(middleware: PlayingInfoNotification())
        player.errorType = CommonError.self
        player.errorLevel = AppErrorLevel.alert
    }
}


extension AppDelegate {
    func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
        
        if router.canOpenURL(url: url) {
            router.open(url: url)
            return true
