improvements for java output