Refactored code for matches carousel