create viewpager
refactor code