improve handshake flow. also add reset command [ci skip]