smarter write buffer