Refactor - build the websocket server incrementally