Optimized Code by making LimitSwitch class an inline function