video 32: refactoring code to use Database class