isolate WS.ts from Client.ts