Get rid of global var