Organize the code of ConnectionWithWsSessions