Refactoring DAO layer.