Use closure instead of class variable.