Created class to convert old $errors into new format