only perform needed array conversions once