refactor & reset buffer every time