internal refactor of database to db for consistency with MPWorks