Refactor checking for vertical or horizontal wins.