refactored code to move dbase calls to their own models.