extracted framing functionality to a separate module called FramingBuffer