refactoring to use ViewPager