                                 for period in periods {
                                     for counter in counters {
                                         // Create the token
-                                        let token = OTPToken(type: type, secret:secretString.dataUsingEncoding(NSASCIIStringEncoding), name:name, issuer:issuer, algorithm:algorithm, digits:digitNumber)
-                                        token.period = period;
-                                        token.counter = counter;
+                                        let token = Token(type: type, secret:secretString.dataUsingEncoding(NSASCIIStringEncoding), name:name, issuer:issuer, algorithm:algorithm, digits:digitNumber, period: period, counter: counter)
 
                                         // Serialize
-                                        let url = token.url;
+                                        let url = token.url();
 
                                         // Test scheme
                                         XCTAssertEqualObjects(url.scheme, kOTPScheme, "The url scheme should be \"\(kOTPScheme)\"");

                                        XCTAssertEqualObjects(queryArguments["issuer"], issuer, "The issuer value should be \"\(issuer)\"");

                                        // Check url again
                                        let checkURL = token.url;
                                        XCTAssertEqualObjects(url, checkURL, "Repeated calls to url() should return the same result!");
                                    }
                                }

    }

}
