removed some garbage code, renamed refreshIfOld to refreshIf