Removing more foreach logic.