Removed unnecessary global variables