refactor with app state has board