Implement patterns a little bit better.
Implement pattern rendering in the text handler