Refactor cursor position methods