Slight refactor to use more LINQ methods