Requires me to rejig the JNI integration, but it's overall good since it allows me to strip away a lot of the logic.