compact all the global variables into a advp struct, which will be the only global variable