Reorganized the class structure.