large clean up of proof code