refactorings & enable web sockets
more refactorings