DRYed the response handlers