revised schema and models