Make the code less websocket dependant.