[Minor] Refactoring to avoid duplicate code

Very merry end of the year :)
I would call it ``updateCache``