refactor gameover