Editor refactoring and working basic insert