Refactoring cd