refactored dao method