I think (but am not 100% sure) that you can simplify this somewhat. I guess the two way arrival at return cursor._more might limit what you can do.