Ghost cursor refactoring