refactoring dao