refactor how receive buffer is handled internally for allocation purposes.