replace class variable by a stack one