Major refactoring in Editor