updated to use db class for database support