revised and flattened the data model