refactored interface to use websockets