Refactor inbuf into a RBuffer(squash)