refactor, library return Client class