more refactor of cpu_vs_player