Remove useless classes such as UI controls and widgets.