handle stop pattern optimized