Refactor cursor to have reference to the current line