models and database schema redone