Refactor card game