Optimized the TypeRestrictor.