Refine response handler