Refactoring websocket connection status (ref #42)