Refactor into Cursor object