Extract D/C values optimization logic into a new class.