re-structure of rpc