New getViewtype method