java side cleanup