video 32 refactoring code to use the database class