optimized code (without function)