Change global variables to instance variables