Refactor boad model and controller