make sendrecv.c more readable