upd: add buffer and formatter support, refactoring