better refactoring of win conditions