Rewrite of the java SDK