split traversal functions into seperate file