Optimizing the java client