restructured db models