Use textVector
Restructure logic and simplify