implements modular response handler