Move code that removes stale backups into subcondition.