better buffer management