First pass on port to Java API