Moving the cache facility to the base RiskCalculator and some refactoring