Refactoring and adding methods to analyze the contents of the database.  Unit tests for these.