improved py4j entry point