refactor: simplified API, pass now in control of traversal