board.js code cleanup