refactor rpc client and tx sending