Moved static variable to method