Refactor get RPC