Add traversable
Refactor and restructure API