reduce complexity of the response handler