factored out the str_split