Added common use routines
Added checkFreshness code