deduplicate code and slim the response class