         ]
 
         var messageBytes = headerBytes + encodeUTF8Length(client) + [UInt8](client.utf8)
-        if let username = self.username {
+
+        if let username = username {
             messageBytes += (encodeUTF8Length(username) + [UInt8](username.utf8))
         }
-        if let password = self.password {
+
+        if let password = password {
             messageBytes += (encodeUTF8Length(password) + [UInt8](password.utf8))
         }
+
         outputStream?.write(messageBytes, maxLength: messageBytes.count)
     }
 

        
        outputStream.write(messageBytes, maxLength: messageBytes.count)
    }

    // MARK: - Utils

    private func encodeVariableLength(_ length: UInt) -> [UInt8] {
        var remainingBytes: [UInt8] = []
        var workingLength = length

        while workingLength > 0 {
            var byte = UInt8(workingLength & 0x7F)
            workingLength >>= 7

                        }

                        let topicPointer = UnsafeBufferPointer(start: messageBuffer + 2, count: topicLength)
                        guard let topic = String(bytes: topicPointer, encoding: .utf8) else {
                            messageParserState = .decodingHeader
                            break
                        }
