This dao is now refactored to operate on a single query.