Extracted file extension validation into a dedicated validator.