CC rewritten with templates