extracted tree traverser into its own package