in the middle of rewriting handshake discovery