remove unused code
handle extra messages send with handshake
lint