Refactor some editor code and add new cursor