refactor set_next_card method