some cleanups in the clientutil.c code.