Remove objectioonable uses of global variables.