Refactored file validation function