simplify class generator logics
use the existing generate2 method to genreate class template
the original generate method should be deprecated
use common method to generate