Refactored rendering of cards