Refactored editor into multiple smaller pieces to increase maintainability.