Refactor cursor and basics for suspend/resume