                     saveBinaryDocument newDoc
 
         updateFileInformation = (existingDoc, newDoc) ->
+
+            # Fullfill document information
             newDoc._id = existingDoc._id
             newDoc._rev = existingDoc._rev
             newDoc.creationDate = existingDoc.creationDate


        populateBinaryInformation = (newDoc) ->
            if newDoc.binary?
                binary.getRemoteDoc newDoc.binary.file.id, (err, binaryDoc) ->
                    uploadBinary newDoc, binaryDoc
            else
                binary.createEmptyRemoteDoc (err, binaryDoc) ->
                    uploadBinary newDoc, binaryDoc

        checkFileExistence = (newDoc) ->
            pouch.allFiles false, (err, existingDocs) ->
                if err and err.status isnt 404
                    callback err

        switch task.operation
            when 'put'
                if task.file?
                    module.exports.createFileDoc task.file, callback
            when 'get'
                if task.file?
                    binary.fetchOne deviceName, task.file, callback
                else
                    binary.fetchAll deviceName, callback
            when 'delete'
                if task.file?
                    module.exports.deleteDoc task.file, callback
            else
                # rebuild
                if task.file?
