Inlined LINQ, removing temporary lists

It's a bit faster and uses less allocations, so the GC is happy as well
Removed redundant ToList()