Refactor HandshakeHelper and add a peeking handshake helper