     
     private func success(token: Token) {
         Queue.main { [weak self] in
-            guard let this = self else { return }
-            
-            this.completion?(.Success(token))
-            this.safariVC?.dismissViewControllerAnimated(true, completion: nil)
+            self?.completion?(.Success(token))
         }
     }
     
     private func failure(error: Error) {
         Queue.main { [weak self] in
-            guard let this = self else { return }
-            
-            this.completion?(.Failure(error))
-            this.safariVC?.dismissViewControllerAnimated(true, completion: nil)
+            self?.completion?(.Failure(error))
         }
     }
     

    public func handleURL(URL: NSURL, options: [String: AnyObject]) {
        guard shouldHandleURL(URL, options: options) else { return }
        
        NotificationCenter.removeObserver(self, name: UIApplicationDidBecomeActiveNotification)
        
        guard let code = URL.query("code") else {

@available(iOS 9.0, *)
extension Provider: SFSafariViewControllerDelegate {
    public func safariViewControllerDidFinish(controller: SFSafariViewController) {
        safariVC?.dismissViewControllerAnimated(true, completion: nil)
        failure(.Cancel)
    }
}
