Remove unused classes and unnecessary references to them