Endgame check refactoring