slight refactor & jni contact work