flatten class structure v2