switch case for view