Refactoring of GAIA cache functions