some refactors, integrate better clank websockets