refactor card_value method