broke out jni code