remove old classes. Fix some bugs