rewrite new instance of java classes