Notice that lines 101, 104 and 105, are there only because I wanted to protect against the case in which the input list "sites" is a mix of SE names and CMS site names, which I guess will never be the case. When I created the function I had in mind to have a generic function that takes as input an array of sites (which can be a mix of SE names and CMS site names) and return an array of the same length with SE names converted into CMS site names. Do you want to remove lines 101, 104 and 105?