optimizations and type checking for strict mode