Update ext.php removing code duplication