Eliminate global variables