Cleaning up websocket code for c++