refactoring stack: inherited from list
refactoring queue: inherited from list