Cleaning up array and string operations