Modify the find logic to use a cursor/query object