view_response helper function