Refactoring traversal framework in snippets.