Added and then enhanced cache meachanism.