Refactored out win conditions.