moving globals into class instances