Removed many LINQ usages to improve performances.