Use a soft-value cache in the class repository, this resolves the memory-leaking issues that the original repository has.