Refactor the BaseDao find logic