Refactoring dao