Code cleanup in the Client and Types libraries