Made some variables static in client to reduce parameter passing.