US4805 Refactor text analyzer