refactoring for fewer usages of strings.Split