Revert "refactor client protocol"

This reverts commit 2b8b7fdfa3204cdfbc8ac8f5b74fd702d2966375.