Refactor Board code