add RepeatUtterance logic, improve memory efficiency, and adjust xml rules