Refactored diagram Editor