Clean DPM code (I think)