Refactor cpl.php.