code cleanup in php and config.php