Isolate the computation of purge interval from background thread logic and move into more suitable file.