Regroup class in an array