Array to class convertor