Removing foreach