remove code duplication with config.php