protocol.c cleanup