refactoring; make it easier to restart the client event loop; make it possible to switch channels