Safer messages handling for WebSocketClient