Refactored mapResponse to use Mapping class