clean up main.php