Redesign and organize the RPC protocol