further code clean up and simplification of websocket handler