refactor websockets class to make underlying object private