Improve performance of metadatatree