Refactor validate_file().