slideshow refactor