wrapper and utils for stacks