simplify and drop global variables