editor cleanup and refactoring