Separate traversal functions into a file of their own