refactor dao