It looks like construct may end up reconstructing same tree several time, so if we could just create a temporary `cache = {}` at the start of search and just pass it in to construct so it can lookup that cache for items that already where just fetched.