Refactor shiftBoard and movePiece