Removing unnecessary ToArray calls