#8 implemented some web socket context and event processing logic