optimized path validator