changed viewClass to class method