refactor Client.run()