Rework

Following Java code