Small editor refactorings

Small changes and refactoring done during the editor source code review.