improved app.php