refactor slideshow