Remove the helper function from Java to make it equivalent to the others