Move the settings global data teardown into its own separate function, instead of intermingled with the global state.