Refactoring cd.

New class added.