refactor with cursor_*