Refactored and added comments to Server.php