Remove duplication in the staleness check