refactor mt-nearest-good-file-number