server.c: clean up code