add flatten Classes and its test