migrated tree builder to Helpers/Indexer.php