Refactoring DAO classes, introducing DaoFactory.