Refactored CompoundShapes class and all of its derived classes