Refactored some code
Connected but getting a handshake error