Move most of the work over to Java