Replace $field[class] with one variable $class