better gen of class