Replaced metadata logic with cache.