Optimized StateChartNode code