clean up some buffer utils