loop and fix
Revert "refactor client protocol"

This reverts commit b4a46b172fdd5255dc673a9fcea0d3c6a527d391.