Common response handling extracted