Extract some of the board manipulation logic out.