(refactor) Use AnyMap instead of TypeMap.