refactor CD class