Some refactoring of the board code.