     open override func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         
-        if !self.captureSession.isRunning {
-            self.captureSession.startRunning()
-        }
+        self.startSession()
         
         if !self.motionManager.isAccelerometerActive {
             self.motionManager.startAccelerometerUpdates(to: OperationQueue.current!, withHandler: { accelerometerData, error in

    open override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)
        
        self.captureSession.stopRunning()
        self.motionManager.stopAccelerometerUpdates()
    }
    

        case .rear:
            self.currentDevice = self.captureDeviceRear ?? self.captureDeviceFront
        }
    }
    
    // MARK: - Session
    
    open func startSession() {
        if !self.captureSession.isRunning {
            self.captureSession.startRunning()
        }
    }
    
    open func stopSession() {
        self.captureSession.stopRunning()
    }
    
    // MARK: - Callbacks
