ToText function seems superfluous as toString() does the job.
Removed functional style to make code clearer.