update java, code cleanup