Refactoring to get a string from an array.