refactor cp