Support for websockets interactions + refactoring