Refactored some editor state