upgraded cache init code for tests