refactors to remove class variable