Update data_structures to use element tree