Make cdc() safer
Optimize