Improved handling of response types