video 32: Refactoring code to use the database