refactor cpu_vs_player