Added index, tree and leaf support