Simplify helper function in board math