Moved logic to app.php.