End game check refactoring.