add function to convert strings to arrays

prevents some code duplication issues