big cleanup of Java API and Array