minimize global variables