Improve main.php