Remove unnecessary global variables.