             return nil
         }
         super.init(url: url)
-        self.onConnect = websocketDidConnect
-        self.onDisconnect = websocketDidDisconnect
-        self.onData = websocketDidReceiveData
-        self.onText = websocketDidReceiveMessage
+        self.onConnect = onConnect
+        self.onDisconnect = onDisconnect
+        self.onData = onData
+        self.onText = onText
     }
 
     override func connect() {

     - parameter wrapper: A `SpeechToTextResultWrapper` that encapsulates the new or updated
        transcriptions along with state information to update the internal `results` array.
     */
    private func didReceiveResults(wrapper: SpeechToTextResultWrapper) {
        if state == .StartedRequest {
            state = .ReceivingResults
        }

        }
    }

    func onConnect() {
        state = .Listening
        operations.suspended = false
        retries = 0
    }

    func onDisconnect(error: NSError?) {
        state = .Disconnected
        operations.suspended = true
        if isAuthenticationFailure(error) {
