Refactored response writing
HAL response writer