Simplify text processing code.