added dcm, started refractoring