Simplify the stack operations using Go interfaces.