Corrected the Java worst practices