Refactor strict-validation function.