refactor rpc test