Moved maptree to helper.