     override func viewDidLoad() {
         super.viewDidLoad()
         
-        let sessionDuration = appSettings.ConfiguredSessionDuration
-        let lastState = appSettings.LastState
-        
-        sessionControl =
-            ProgrammingSession(
-                withDeveloper: lastState.currentDeveloper,
-                delegate: SessionDelegateNotificationDecorator(other: self, notifications: LocalNotifications(timeInterval: sessionDuration.TotalSeconds)),
-                timer: SystemTimer(durationInSeconds: sessionDuration.TotalSeconds, repeatWhenExpired: false),
-                dateTime: SystemDateTime(),
-                sessionDurationInMinutes: sessionDuration.TotalMinutes)
-
-        sessionControl =
-            sessionControl?.restoreState(sessionState: lastState.sessionState, sessionEndsOn: lastState.sessionEndsOn)
+        initializeNotifications()
+        initializeProgrammingSession()
         
         updateUserInterface(developer: sessionControl!.developer)
-        
-        initializeNotifications()
     }
 
     @IBAction func actionFlipDeveloper(_ sender: Any) {

        
        guard let sessionControl = sessionControl else { return }
        
        appSettings.LastState =
            AppState(
                    currentDeveloper: developer ?? sessionControl.developer,
                    sessionState: sessionState,

        
    }
    
    private func initializeProgrammingSession() {
        
        let appSettings = AppSettings()
        let sessionDuration = appSettings.ConfiguredSessionDuration
        let lastState = appSettings.LastState
        
        sessionControl =
            ProgrammingSession(
                withDeveloper: lastState.currentDeveloper,
                delegate: SessionDelegateNotificationDecorator(other: self, notifications: LocalNotifications(timeInterval: sessionDuration.TotalSeconds)),
                timer: SystemTimer(durationInSeconds: sessionDuration.TotalSeconds, repeatWhenExpired: false),
                dateTime: SystemDateTime(),
                sessionDurationInMinutes: sessionDuration.TotalMinutes)
        
        sessionControl =
            sessionControl?.restoreState(sessionState: lastState.sessionState, sessionEndsOn: lastState.sessionEndsOn)
    }
    
    private func updateDeveloperImages(activeDeveloper: Developer) {
        rightDeveloperImageView.image = developerStateImage(isActive: activeDeveloper == .right)
        leftDeveloperImageView.image = developerStateImage(isActive: activeDeveloper == .left)
