modularize buffer and editor