more classes and some restructuring