Refactor slideshow