try to improve byte buffers + additional cleanups