Refactoring of init/clean editor buffer.