split handling of messages in RPC