Rename TimerPattern to TextPattern

Optimize the textPattern code