refactoring mappedTo calculation