code cleaner, and the protocol becomes stateful