reorganized class structure