move some websocket stuff round