RPC coroutine handling refactoring