Split cache into class_cache, for better reusability