 
 // MARK: - ImageLoading
 
-/** Performs loading of images for the given tasks.
-*/
+/// Performs loading of images for the given tasks.
 public protocol ImageLoading: class {
-    /** Manager that controls image loading.
-     */
+    /// Manager that controls image loading.
     weak var manager: ImageLoadingManager? { get set }
     
-    /** Resumes loading for the given task.
-     */
+    /// Resumes loading for the given task.
     func resumeLoadingFor(task: ImageTask)
     
-    /** Suspends loading for the given task.
-     */
+    /// Suspends loading for the given task.
     func suspendLoadingFor(task: ImageTask)
     
-    /** Cancels loading for the given task.
-     */
+    /// Cancels loading for the given task.
     func cancelLoadingFor(task: ImageTask)
     
-    /** Compares requests for equivalence with regard to caching output images. This method is used for memory caching, in most cases there is no need for filtering out the dynamic part of the request (is there is any).
-     */
+    /// Compares requests for equivalence with regard to caching output images. This method is used for memory caching, in most cases there is no need for filtering out the dynamic part of the request (is there is any).
     func isCacheEquivalent(lhs: ImageRequest, to rhs: ImageRequest) -> Bool
     
-    /** Invalidates the receiver. This method gets called by the manager when it is invalidated.
-     */
+    /// Invalidates the receiver. This method gets called by the manager when it is invalidated.
     func invalidate()
     
-    /** Clears the receiver's cache storage (if any).
-     */
+    /// Clears the receiver's cache storage (if any).
     func removeAllCachedImages()
 }
 
 // MARK: - ImageLoadingDelegate
 
-/** Manages image loading.
-*/
+/// Manages image loading.
 public protocol ImageLoadingManager: class {
-    /** Sent periodically to notify the manager of the task progress.
-     */
+    /// Sent periodically to notify the manager of the task progress.
     func loader(loader: ImageLoading, task: ImageTask, didUpdateProgress progress: ImageTaskProgress)
     
-    /** Sent when loading for the task is completed.
-     */
+    /// Sent when loading for the task is completed.
     func loader(loader: ImageLoading, task: ImageTask, didCompleteWithImage image: Image?, error: ErrorType?, userInfo: Any?)
 }
 
 // MARK: - ImageLoaderConfiguration
 
+/// Configuration options for an ImageLoader.
 public struct ImageLoaderConfiguration {
+    /// Performs loading of image data.
     public var dataLoader: ImageDataLoading
+
+    // Decodes data into image objects.
     public var decoder: ImageDecoding
     
-    /** Maximum number of concurrent executing NSURLSessionTasks. Default value is 10.
-     */
-    public var maxConcurrentDataTaskCount = 10
-    
-    /** Image decoding queue. Default queue has a maximum concurrent operation count 1.
-     */
+    /// Maximum number of concurrent executing NSURLSessionTasks. Default value is 10.
+    public var maxConcurrentSessionTaskCount = 10
+    
+    /// Image decoding queue. Default queue has a maximum concurrent operation count 1.
     public var decodingQueue = NSOperationQueue(maxConcurrentOperationCount: 1)
     
-    /** Image processing queue. Default queue has a maximum concurrent operation count 2.
-     */
+    /// Image processing queue. Default queue has a maximum concurrent operation count 2.
     public var processingQueue = NSOperationQueue(maxConcurrentOperationCount: 2)
 
-    /** Determines whether the image loader should reuse NSURLSessionTasks for equivalent image requests. Default value is true.
-     */
+    /// Determines whether the image loader should reuse NSURLSessionTasks for equivalent image requests. Default value is true.
     public var taskReusingEnabled = true
 
+    /// Deprecated, use `maxConcurrentSessionTaskCount` instead.
     @available(*, deprecated=2.2)
     public var congestionControlEnabled = true
     

                    // Underlying data task is cancelled when there are no outstanding tasks (executing or suspended) registered with it.
                    dataTask.executingTasks.remove(task)
                    dataTask.suspendedTasks.remove(task)
                    if dataTask.tasks.isEmpty {
                        self.taskQueue.cancel(dataTask.URLSessionTask)
                    }
                case .Processing(let operation):

        }
    }
        
    private func remove(task: DataTask) {
        // We might receive signal from the task which place was taken by another task
        if self.dataTasks[task.key] === task {
            self.dataTasks[task.key] = nil
