Change array to class