Refactoring CCS extraction