rewrite client to use CilentLib