refactor piece/board class and finish exc No. 3 in chapter4 :pear: