Refactored response.php