Refactored site.php