Simplifying the Java call logic