Minor refactoring on Stack