Moved heterogenize and homogenize into IndexedList.