refactored to get a typed mapper instance to reuse instead of lookup every time it is needed