refactor board class