refactor dao and service