performance - use the java method if possible