rewrite ViewSwitcher as class