     }
 
     static func tokenWithURL(url: NSURL, secret: NSData?) -> Self? {
-        if let urlString = url.absoluteString {
-            if let token = Token.URLSerializer.deserialize(urlString, secret: secret) {
-                let otp = self.init()
-                otp.updateWithToken(token)
-                return otp
-            }
+        if let token = Token.URLSerializer.deserialize(url.absoluteString, secret: secret) {
+            let otp = self.init()
+            otp.updateWithToken(token)
+            return otp
         }
         return nil
     }

    func saveToKeychain() -> Bool {
        if let token = token {
            if let keychainItem = self.keychainItem {
                if let newKeychainItem = updateKeychainItemWithToken(keychainItem, token) {
                    self.keychainItem = newKeychainItem
                    return true
                }

    // This should be private, but is public for testing purposes
    func generatePasswordForCounter(counter: UInt64) -> String? {
        if let token = token {
            return generatePassword(token.core.algorithm, digits: token.core.digits, secret: token.core.secret, counter: counter)
        }
        return nil
    }
