Remove unnecessary global variables