Make editor control code more modular