Removing unnecessary classes and refactoring others