Improve handshaking