change buffertools usage and add tests