method for switching between view types