Why the factory is the shape
A test that builds an app is a test that owns its app. A test that reaches a global is a test that depends on import order.
The one symptom of a global app
Two tests that change the same setting. The change is visible in the other test, and the cause is the shared object.