refactoring of dao