First stage of contract cleanup