update models and database functions