Did some preliminary refactoring of the logic in board