Added caching of previously processed types.