move helpers to textutils