refactoring slideshow