Code revised according to  Java style hints