Updated to use new database class