editor refactor and fixes