modify some variable and function and improve the cache refreshing operation