Refactored the handshakes