reconstruct the data hierarchy