Stop using  global variable