Refactored game finished check