extract editor as directive for general use, refactoring