refactored dashboard_model to use the new database model functions