Move handshake protocol to own handler