Refactored stack.