move stuff from java version