General code cleanup

I removed unused directives from each class, removed redundant
qualifiers, and converted a foreach statement to a LINQ statement.