decrease the java and groovy code.