cache expire time refactoring