rewrite classes from Scala to Java, remove Scala dependency