refactor & using viewswitcher