Rewrite view to class-based