remove unnecessary global variables