Replaced the use of a global with a class variable.