         guard let content = html.dataUsingEncoding(NSUTF8StringEncoding) else {
             let failureReason = "HTML could not be encoded to NSData with NSUTF8StringEncoding."
             let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason]
-            let error = NSError(domain: PersonalityInsights.domain, code: 0, userInfo: userInfo)
+            let error = NSError(domain: domain, code: 0, userInfo: userInfo)
             failure?(error)
             return
         }

    private let username: String
    private let password: String

    private static let domain = "com.ibm.watson.developer-cloud.WatsonDeveloperCloud"
    private static let serviceURL = "https://gateway.watsonplatform.net/personality-insights/api/v2"
    private static let profileURL = serviceURL + "/profile"

    public init(username: String, password: String) {
        self.username = username

        guard let content = text.dataUsingEncoding(NSUTF8StringEncoding) else {
            let failureReason = "Text could not be encoded to NSData with NSUTF8StringEncoding."
            let userInfo = [NSLocalizedFailureReasonErrorKey: failureReason]
            let error = NSError(domain: domain, code: 0, userInfo: userInfo)
            failure?(error)
            return
        }
