Refactored WebSocketServiceHost.cs