         }
 
         let after = delay * Double(NSEC_PER_SEC)
-        let time  = dispatch_time(DISPATCH_TIME_NOW, Int64(after))
-        dispatch_after(time, dispatch_get_main_queue(), {
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(after)), dispatch_get_main_queue()) {
             self._start()
-        })
-    }
-
-    func _start() {
-        if let _layer = layer {
-            _layer.addAnimation(animation, forKey: animation!.keyPath.hash.description)
-            if let animation = animation as? Animation {
-                _layer.setValue(animation.valueAfterAnimation, forKeyPath: animation.keyPath)
-            }
+        }
+    }
+
+    private func _start() {
+        if let layer = layer, let animation = animation {
+            layer.addAnimation(animation, forKey: animation.keyPath.hash.description)
+            layer.setValue(animation.valueAfterAnimation, forKeyPath: animation.keyPath)
         } else {
             finish()
         }


    var duration: NSTimeInterval {

        var duration = 0.0
        for task: Task in tasks {
            var d: NSTimeInterval = {
                if let animation = task.animation {
                    return task.delay + animation.duration
                }

            finish()
        }

        for task in tasks {
            task.delegate = self
            task.start()
        }
