Clean up websocket reconnect code