refactored to remove unnecessary Mapping class