Put split-string-at-comma code into a function
Eliminate local var from trim()