use better generic cursor api