Use linq instead of manual iteration