Simplified handshaking code.