refactoring in dao