refactor compiler websocket