simplify traverse()