Refactor threddsfile checking.