refactor checking win conditions