refactoring the send and receive buffers