Refactor ForEachComponent to ForEach