refactor buffer
fix typo
minor