Refactor the setting of PrivateGlobalPrefix.

No functionality change.