simplify js/carousel.js