         outputAudioFormatDescription = nil
         outputVideoFormatDescription = nil
 
-        guard let unwrappedVideoConnection = videoDataOutput.connectionWithMediaType(AVMediaTypeVideo) else {
-            throw MedusaError.CaptureDeviceError
-        }
-
-        guard let unwrappedAudioConnection = audioDataOutput.connectionWithMediaType(AVMediaTypeAudio) else {
-            throw MedusaError.AudioDeviceError
-        }
-
-        videoConnection = unwrappedVideoConnection
-        audioConnection = unwrappedAudioConnection
-    }
-}
+        (videoConnection, audioConnection) = try fetchConnections(fromVideoDataOutput: videoDataOutput, andAudioDataOutput: audioDataOutput)
+    }
+}
+
 
 // MARK: AssetWriterCoordinatorDelegate
 


        self.recordingURL = recordingURL

        try super.init(sessionPreset: sessionPreset)

        try addOutput(videoDataOutput, toCaptureSession: captureSession)
        try addOutput(audioDataOutput, toCaptureSession: captureSession)

        guard let unwrappedVideoConnection = videoDataOutput.connectionWithMediaType(AVMediaTypeVideo) else {
            throw MedusaError.CaptureDeviceError
        }

        guard let unwrappedAudioConnection = audioDataOutput.connectionWithMediaType(AVMediaTypeAudio) else {
            throw MedusaError.AudioDeviceError
        }

        videoConnection = unwrappedVideoConnection
        audioConnection = unwrappedAudioConnection

        let videoDataOutputQueue = dispatch_queue_create("top.limon.capturesession.videodata", DISPATCH_QUEUE_SERIAL)
        let audioDataOutputQueue = dispatch_queue_create("top.limon.capturesession.audiodata", DISPATCH_QUEUE_SERIAL)


        synchronized(self) {
            guard recordingStatus == .StoppingRecording else { return }
        }

        synchronized(self) {
