refactor autoSlide