It would be possible to move this into a factory if desired, where the mime type is going in and the right response instance would be returned. That would also require a common interface for responses that can carry data.