Optimized validation (still working on it)