Refactored solution to use Card objects