refactor removePiece() method