extract end detection to game end service