refactored -moved cachefactory to service pacakge