Introduce Cursor type to avoid calling 'delete' on a list.