refact: refact text processing functions to text_fmt object