improve switch testing