Refine logic in carousel rotation.