Buffers api refactor