Code of dcs.c refactored to open possibility of CCS adding.