refactoring..STACK