             break
         }
     }
-    /*
-    func resolve<T: Thenable where T.ValueType == V, T.ReasonType == NSError, T.ReturnType == Void>(#thenable: T) -> Void
-    {
-        if self.state != .Pending {
-            return
-        }
-        
-        if (thenable as? Promise<V>) === self {
-            self.reject(NSError.promiseTypeError())
-        }
-        else {
-            thenable.then(
-                onFulfilled: { (value: V) -> Void in
-                    self.resolve(value)
-                },
-                onRejected: { (reason: NSError) -> Void in
-                    self.reject(reason)
-                }
-            )
-        }
-        
-    }
-    
-    // MARK: - Public APIs
-    
-    public func resolve(value: V) -> Void
-    {
-        if self.state != .Pending {
-            return
-        }
-        
-        self.value = value
-        self.state = .Fulfilled
-        
-        for callback in self.fulfillCallbacks {
-            callback(value: value)
-        }
-    }
-    
-    public func reject(reason: NSError) -> Void
-    {
-        if self.state != .Pending {
-            return
-        }
-        
-        self.reason = reason
-        self.state = .Rejected
-        
-        for callback in self.rejectCallbacks {
-            callback(reason: reason)
-        }
-    }
-    */
+
     // MARK: - Static APIs
     
     public class func defer() -> (Deferred<V>, Promise<V>) {
         let deferred = Deferred<V>()
         return (deferred, deferred.promise)
     }
+    
+    // MARK: - Thenable
+    
+    public typealias NextType = Promise<Void>
+    public typealias ValueType = V
+    public typealias ReasonType = NSError
+    public typealias ReturnType = Void
+    
+    public func then(
+        onFulfilled: Optional<(value: V) -> Void> = nil,
+        onRejected: Optional<(reason: NSError) -> Void> = nil
+        ) -> Promise<Void>
+    {
+        let (nextDeferred, nextPromise) = Promise<Void>.defer()
+        
+        self.bindCallbacks(
+            fulfillCallback: { (value) -> Void in
+                if let resolution = onFulfilled? {
+                    resolution(value: value)
+                    nextDeferred.resolve()
+                }
+                else {
+                    nextDeferred.resolve()
+                }
+            },
+            rejectCallback: { (reason) -> Void in
+                if let rejection = onRejected? {
+                    rejection(reason: reason)
+                    nextDeferred.resolve()
+                }
+                else {
+                    nextDeferred.reject(reason)
+                }
+            }
+        )
+        
+        return nextPromise
+    }
+
+    // MARK: - Thenable enhance
+    
+    public func then(
+        onFulfilled: (value: V) -> Void
+        ) -> Promise<Void>
+    {
+        let (nextDeferred, nextPromise) = Promise<Void>.defer()
+        
+        self.bindCallbacks(
+            fulfillCallback: { (value) -> Void in
+                onFulfilled(value: value)
+                nextDeferred.resolve()
+            },
+            rejectCallback: { (reason) -> Void in
+                nextDeferred.reject(reason)
+            }
+        )
+        
+        return nextPromise
+    }
+    
+    public func catch(
+        onRejected: (reason: NSError) -> Void
+        ) -> Promise<Void>
+    {
+        let (nextDeferred, nextPromise) = Promise<Void>.defer()
+        
+        self.bindCallbacks(
+            fulfillCallback: { (value) -> Void in
+                nextDeferred.resolve()
+            },
+            rejectCallback: { (reason) -> Void in
+                onRejected(reason: reason)
+                nextDeferred.resolve()
+            }
+        )
+
+        return nextPromise
+    }
+    
+    public func then<N: Any>(
+        #onFulfilled: (value: V) -> N,
+        onRejected: (reason: NSError) -> N
+        ) -> Promise<N>
+    {
+        let (nextDeferred, nextPromise) = Promise<N>.defer()
+        
+        self.bindCallbacks(
+            fulfillCallback: { (value) -> Void in
+                let nextValue = onFulfilled(value: value)
+                nextDeferred.resolve(nextValue)
+            },
+            rejectCallback: { (reason) -> Void in
+                let nextValue = onRejected(reason: reason)
+                nextDeferred.resolve(nextValue)
+            }
+        )
+        
+        return nextPromise
+    }
+    
+    public func then<N>(
+        onFulfilled: (value: V) -> N
+        ) -> Promise<N>
+    {
+        let (nextDeferred, nextPromise) = Promise<N>.defer()
+        
+        self.bindCallbacks(
+            fulfillCallback: { (value) -> Void in
+                let nextValue = onFulfilled(value: value)
+                nextDeferred.resolve(nextValue)
+            },
+            rejectCallback: { (reason) -> Void in
+                nextDeferred.reject(reason)
+            }
+        )
+
+        return nextPromise
+    }
+
+    public func then<N, T: Thenable where T.ValueType == N, T.ReasonType == NSError, T.ReturnType == Void>(
+        #onFulfilled: (value: V) -> T,
+        onRejected: (reason: NSError) -> T
+        ) -> Promise<N>
+    {
+        let (nextDeferred, nextPromise) = Promise<N>.defer()
+        
+        self.bindCallbacks(
+            fulfillCallback: { (value) -> Void in
+                let nextThenable = onFulfilled(value: value)
+                nextDeferred.resolve(thenable: nextThenable)
+            },
+            rejectCallback: { (reason) -> Void in
+                let nextThenable = onRejected(reason: reason)
+                nextDeferred.resolve(thenable: nextThenable)
+            }
+        )
+        
+        return nextPromise
+    }
+    
+    public func then<N, T: Thenable where T.ValueType == N, T.ReasonType == NSError, T.ReturnType == Void>(
+        onFulfilled: (value: V) -> T
+        ) -> Promise<N>
+    {
+        let (nextDeferred, nextPromise) = Promise<N>.defer()
+        
+        self.bindCallbacks(
+            fulfillCallback: { (value) -> Void in
+                let nextThenable = onFulfilled(value: value)
+                nextDeferred.resolve(thenable: nextThenable)
+            },
+            rejectCallback: { (reason) -> Void in
+                nextDeferred.reject(reason)
+            }
+        )
+        
+        return nextPromise
+    }
+}
+
+public extension Promise {
     
     public class func resolve<V>(value: Any) -> Promise<V>
     {

        var results: [V] = []
        
        let (allDeferred, allPromise) = Promise<[V]>.defer()

        for promise in promises
        {
            promise.then(

    {
        return self.race(promises)
    }
}

public extension Promise {
