move class Cache into global class as a extended. Use a function instead.