websocket implementations completed, refactoring client protocol