Changing the way the iterator works and handling array and string items in the same switch saves up to 1sec.