Cleaner global variable management