stack: clean code of several stacks