Cavity-breeding birds create specific microhabitats for diverse arthropod communities in boreal forests

The nests of secondary cavity-nesters located in tree cavities may form specific microhabitats of conservation importance due to their limited accessibility and availability. Species-specific nesting materials in nests of different secondary cavity-nesters may furthermore provide very different microhabitats for arthropods. The potential differences in arthropod communities inhabiting nests of different bird species in excavated cavities or nest boxes have, however, rarely been studied despite their relevance for conservation. Here we investigated the diversity and composition of arthropod communities in these different cavity types and bird species’ nests in managed boreal forests. We identified morphologically and by DNA-metabarcoding arthropods in nest materials that were collected in and compared between (i) woodpecker-size cavities from seven different combinations of cavity type (nest box or excavated cavity), tree species (aspen or pine) and accumulation history of nest materials (single-season cleaned or uncleaned nest boxes that accumulated nests of passerines or an owl species); and (ii) nests of two different passerine species in small nest boxes. We identified 64 arthropod taxa in ten orders, from which Diptera, Coleoptera, Siphonaptera, and Lepidoptera were the most abundant. Shannon diversity index was similar among the cavity-nest-type combinations, but taxa richness was the highest in the owl nests. The arthropod communities (especially Histeridae beetles) deviated most from the other types of nests in owl and aspen cavity nests with more advanced decomposition of nest material (soil or wet environment related taxa). The differences in arthropod communities between the different nest types point out the importance of the ecological chain “tree cavities—bird nests—arthropod communities”.

Arthropod diversity has been studied in open cup nests (Carvallo et al. 2020;Błońska et al. 2021), burrow nests (Krištofík et al. 1994(Krištofík et al. , 1996 and cavity nests (Eeva et al. 2015;Hanmer et al. 2017;Baardsen et al. 2021). While both of these nest types provide microhabitats for arthropods, the nests in cavities form a special microhabitat and resource because, unlike the typically very short-lived open cup nests, they can remain in cavities for years, and because breeding of many secondary cavity-nesters depends on the availability of cavities excavated by primary cavity nesters (Hardin et al. 2021;Trzcinski et al. 2022). The ecological chain "excavated tree cavities → secondary cavity breeders' nests → arthropod communities" can thus be seriously impacted already at the first link by intensive forest management practices resulting in a shortage of excavated cavities (Cockle et al. 2010;Edworthy and Martin 2013;Andersson et al. 2018). The availability of tree cavities or trees suitable for excavating by primary cavity-nesters is affected by logging and clear-cutting (Hardenbol et al. 2019), removal of dead standing trees (snags) (Vatka et al. 2014), and cultivation of tree stands with low tree species diversity (monocultures) (Remm and Lõhmus 2011). To at least partly compensate for the limited breeding opportunities for secondary cavity breeders, artificial nest boxes have been installed in various forest environments (Newton 1994;Holt and Martin 1997). Nest boxes may, however, differ from natural cavities in their arthropod community either due to their different habitat or microenvironment. For example, people often remove old nests from nest boxes, while the material can accumulate in natural cavities.
The cavity nests have been studied as microhabitats for arthropods mostly in the nest boxes, and only a few studies compared arthropod communities between nest boxes and natural cavities (McComb and Noble 1982;Wesołowski and Stańska 2001;Broughton et al. 2015;Saunders et al. 2021). These artificial and natural cavity types can considerably differ in their microclimate (McComb and Noble 1981;Maziarz et al. 2017;Strain et al. 2021). Specifically, tree cavities usually experience more stable internal daily temperatures (McComb and Noble 1981;Clement and Castleberry 2013;Maziarz et al. 2017;Strain et al. 2021;Sudyka et al. 2022) and are relatively colder compared to nest boxes (McComb and Noble 1981;Maziarz et al. 2017;Schwartz et al. 2020;Strain et al. 2021). On the other hand, tree cavities are characterized by higher relative humidity than nest boxes (McComb and Noble 1981;Maziarz et al. 2017;Schwartz et al. 2020;Strain et al. 2021;Sudyka et al. 2022), although the nest boxes can become more humid than cavities during the nestling stage (Sudyka et al. 2022). Among the important parameters affecting internal temperature and relative humidity are thickness of the wall of a cavity or nest box (Strain et al. 2021), diameter of a cavity-bearing tree (Wiebe 2001;Maziarz et al. 2017;Vierling et al. 2018;Schwartz et al. 2020), and the level of solar exposure (Rowland et al. 2017;Jarolimek and Vierling 2019). These differences in microclimate between the cavity types imply that the arthropod diversity in nests of a particular bird species could vary depending on whether it breeds in a nest box or an excavated cavity.

3
The nesting material and the other matter present, like food remains and faeces, can substantially shape the composition of an arthropod community. Some materials can attract the arthropods, while others repel them. An increased proportion of grass in nests had a positive effect on tineid moth (Tineidae) abundance (Boyes and Lewis 2019), more faeces attracted more Diptera flies (Ibáñez-Álamo et al. 2016), and accumulated remains of food and droppings increased species richness of nidicolous beetles in nest boxes (Cosandey et al. 2021). Conversely, the arthropods can avoid specific nest conditions. The presence of anthropogenic material contributed to lower arthropod diversity (Hanmer et al. 2017) or lower ectoparasite load (Suárez-Rodríguez et al. 2013) and the use of aromatic plants decreased arthropod diversity (Clark and Mason 1985;Lafuma et al. 2001). These partly species-specific differences in the attractiveness of nesting material (Hansell 2000;Biddle et al. 2018) could produce interspecific differences between the nest-dwelling arthropod communities. Studying these potential differences in arthropod diversity between nests of different bird species is important from the conservation perspective. If we know which types of bird nests are preferred or avoided by the arthropods, we can aim to provide the types of nest boxes or natural cavities that meet the requirements of both birds and arthropods, when possible. However, the recommendations should also consider a dilemma of possibly supporting the bird ectoparasites, being integral parts of the bird nest ecosystem and its biodiversity.
Various functional groups of arthropods characterized by feeding behaviour have been identified in bird nests. The saprophagous arthropods benefit from the decomposing nesting material or bird prey remains providing a food source (Roy et al. 2013). The accumulated feathers and animal fur, also brought in to increase nest insulation, attract more specialized saprophages, the keratophagous arthropods (Boyes and Lewis 2019;Sato et al. 2019). Other functional groups can be the scavengers (Neubig and Smallwood 1999;Cosandey et al. 2021) or carnivorous species (Krištofík et al. 2013) feeding on various developmental stages (eggs, larvae, nymphs, adults) of the other arthropods in the nests. One of the most specialized groups of nest dwellers are parasitoids (Daoust et al. 2012), whose occurrence depends on specific species present in the arthropod community. Apart from these functional groups, the ectoparasites living on chicks are regularly present in the nests (Heeb et al. 2000). Even though they are not always directly connected with the nesting material as a microhabitat, we consider also them in as a part of the bird nest arthropod community as they are involved in the complex trophic interactions among arthropods found in bird nests (Woodroffe 1953;Wolfs et al. 2012;Baardsen and Matthysen 2022).
The relationship between arthropods and bird nests as their habitats can range from an almost exclusive to facultative use. The nests can represent the main habitat the arthropods dwell in, as in some of Tineidae (Lepidoptera; Landry et al. 2013). The arthropods can also be attracted by the accumulated structures during bird breeding-the faeces and food remains, as in some Histeridae (Coleoptera; Krištofík et al. 2003) They can also use them facultatively because the nesting materials can resemble the environment they generally live in, like the litter on forest floor, as in some myriapods (Tajovský et al. 2001). The arthropods can come to bird nests from various source environments or microhabitats including, e.g. plant litter layer, dead wood, carcasses, dung, or microhabitats associated with fungi. For arthropod species with limited dispersal abilities, the bird nests may serve as stepping stones, increasing connectivity of their populations. The other important attribute of nest substrate is its protection from the outer environment and weather conditions by being located in a nest box or tree cavity. Given this, bird nests could be seen as structures contributing to conservation of those species depending on temporary resources like decaying flesh, which can be found in cavities/nest boxes occupied by owls or birds of prey (Merkl et al. 2004;Cosandey et al. 2021). Even though the arthropod communities in bird nests 1 3 have not been considered of conservation concern, it may rather be due to lack of knowledge on them than there being no reason for concern, given the wide impact of forest loss and management on cavity availability (Remm and Lõhmus 2011;Andersson et al. 2018).
Previous research on the arthropod communities living in nests of cavity-breeding birds focused mainly on nest boxes and less on excavated tree cavities, and complex studies considering different cavity types and including different nest histories are virtually absent.
Here we aimed to address the mentioned aspects in a study that covers the main cavity types available for birds and thereafter for arthropods in a managed boreal forest environment. Our goal was to reveal the arthropod diversity in great spotted woodpecker -size cavities and compare it between seven different combinations of cavity type (nest box or excavated cavity), tree species of the excavated cavities (aspen or Scots pine) and accumulation history of nest materials (cleaned nest boxes with single-season nests or accumulated nest materials of passerines or Eurasian pygmy owls Glaucidium passerinum). In a separate model, we also analysed the difference between nest boxes and excavated cavities. We note these two models were separate instead of a fully factorial design because some combinations do not exist in nature (e.g. cleaned excavated cavities). We included also a comparison between nests of two different passerine species in small nest boxes that are typically used for these species.
We expected the arthropod communities to be different between the nest types because the nest boxes and excavated cavities generally differ in their attributes (see above), which could also apply to cavities excavated in different tree species. Also the different nest histories resulting from processes like the accumulation of various plant and animal matter could create substantially different nesting environments and thus shape the arthropod communities in nests of different histories. To examine whether this is the case, we experimentally cleaned some woodpecker-size nest boxes annually while we allowed other boxes to accumulate the nests and other materials. The final important aspect in the study was the importance of bird species building the nest or hoarding food (nests of Parus tits, pied flycatchers Ficedula hypoleuca and pygmy owls, and food hoards of the pygmy owl). Since only few pied flycatcher nests were found in the woodpecker-size cavities, we made a separate data collection on small nest boxes for getting both tit and flycatcher nests from them.

Study area
The arthropod communities were studied in managed southern boreal forests, 10 to 40 km north from the city of Turku (60°27′ N, 22°15′ E) in Southwest Finland (Turku study area), and 5 to 10 km SW from the municipality of Harjavalta (61°19′ N, 22°08′ E; Harjavalta study area), located ca. 100 km north from Turku in Satakunta region (Fig. 1). In forests of the study regions the dominating tree species are Scots pine Pinus sylvestris and Norway spruce Picea abies, deciduous trees being represented mainly by silver and downy birch Betula pendula, B. pubescens and European aspen Populus tremula (Peltola et al. 2020).

Experimental design
In our study areas, we checked nest boxes by opening their roofs (at 1.5 m height) and tree cavities by using a pole-mounted inspection camera (Wildlife Windows Ltd), 1-3 times 1 3 Fig. 1 Positions of excavated cavities ♦ (n = 24) and medium-sized nest boxes • (n = 69) from which we collected bird nests in Turku study area (large map) and small nest boxes ▲ (n = 20) in the Harjavalta study area in Satakunta region (small map) in Southwest Finland. The numbers on the symbols denote the aggregated counts of respective cavity types. Background map depicts main land cover classes derived from a modified Corine Land Cover 2018 raster (SYKE 2021) 1 3 in the breeding season (May to early July) to follow breeding attempts. Active use of a cavity or nest box was documented by presence of eggs, incubating female, or chicks. From the collected nests, we separated the arthropods and identified them; for a subset of nests DNA-metabarcoding was used. In Turku study area, we conducted an experiment on removal of the old nesting material from the medium-sized nest boxes. In about half of randomly selected nest boxes the old nests had always been removed in the previous autumn, while the other nest boxes had not been cleaned for 4-8 years before collecting the study material.
The nest types as described below cover potentially different nest microhabitats in our study areas while take into consideration the main factors forming the nests, i.e. bird species, tree species, and accumulation process.

Nest types and breeding bird species
We collected altogether 113 nests of cavity breeding birds (Fig. 1). A description of how the nests were divided into different combinations of cavity and nest types, and to different tree and bird species, is given in Table 1. The nests in Turku study area were extracted from (1) excavated (great spotted woodpecker Dendrocopos major) cavities (n = 24) and (2) medium-sized nest boxes (great spotted woodpecker size; n = 69). The nests in Harjavalta study area were extracted from small wooden nest boxes (see below) (n = 20). Table 1 Summary statistics of the cavity types, nest types, nest building species, and arthropod taxa Small-GT nests of great tit in small nest boxes, Small-PF nests of pied flycatcher in small nest boxes, Cavaspen accumulated nests of great tit and blue tit in common aspen, Cav-pine accumulated nests of great tit and pied flycatcher in Scots pine, One-season nests of great tit built in the current breeding season in medium-sized nest boxes, Accum accumulated nests of great tit in medium-sized nest boxes, PO-hoard nests containing old food hoards accumulated by pygmy owl, with fresh or accumulated great tit nests, POnest nests of pygmy owl, built in the current breeding season, PO-nest-old 1-3 years old nests of pygmy owl, with fresh or accumulated great tit nests on top. Bird species are the nest building species associated with respective nest types

Excavated tree cavities
The great spotted woodpecker cavities were excavated either in common aspen n = 14) or Scots pine (Cav-pine, n = 10). The aspen cavities were characterized by: entrance hole diameter vertically 24-50 mm and horizontally 30-50 mm, front wall thickness 30-80 mm, and entrance-back wall distance 85-290 mm. The pine cavities had dimensions of: entrance hole diameter vertically 42-55 mm and horizontally 42-50 mm, front wall thickness 35-60 mm, and entrance-back wall distance 67-215 mm. The cavities contained: (i) nests built in the current breeding season, i.e. only fresh, and no old (accumulated) nesting materials (n aspen = none, n pine = 1); (ii) nests built in the previous season(s), i.e. only old (accumulated) nesting materials (n aspen = 4, n pine = 3); (iii) combinations of a fresh nest on top and accumulated nesting materials below (n aspen = 10, n pine = 6). All these different cavities were occupied in variable proportions by common secondary cavity breeders in the study area: great tit (Parus major), blue tit (Cyanistes caeruleus), and pied flycatcher. When breeding had occurred in the current breeding season, we collected the nests from excavated tree cavities a few days up to 2 months after fledging, in June to September 2021.
In the same period, we also extracted old inactive nests built in the previous season(s).

Medium-sized nest boxes
The medium-sized nest boxes were characterized by: entrance hole diameter 46 mm, front wall thickness > 50 mm, cavity diameter 14-17 cm. They were occupied by great tit, pied flycatcher, and pygmy owl (PO), an owl that used them also for food hoarding. Based on the nest box treatment and species using them, we distinguished five nest types: (1) Oneseason-great tit nests built in the current breeding season, consisting of fresh nesting material (n = 27); (2) Accum-great tit nests, rarely also pied flycatcher nests, consisting of accumulated nesting material, fresh material could be also present (n = 15); (3) POhoard-nests containing old food hoards accumulated by PO (n = 10), typically with stored voles, shrews or small passerines, with fresh or accumulated great tit nests in all but one case; (4) PO-nest-nests of pygmy owl built in the current breeding season (n = 7), no tit nests were present except in one case; (5) PO-nest-old-1-3 years old PO nests (n = 10), with fresh or accumulated great tit nests on top. When breeding had occurred in the current breeding season, we collected the nests from medium-sized nest boxes a few days up to a few weeks after fledging, in June and July 2019, 2020 and 2021. In the same periods, we also extracted old inactive nests built in the previous season(s).

Small nest boxes
The small nest boxes in Harjavalta were characterized by: entrance hole diameter 32 mm and bottom area 12 × 12 cm. We collected one-year nests from them, when distinguishing Small-GT nests (occupied by great tit, n = 10) and Small-PF (occupied by pied flycatcher, but some moss brought earlier by the great tit was also possible, n = 10). We collected the nests from small nest boxes a few days up to a few weeks after fledging, in June and July 2020.

Parameters of cavities and nests
The volume of the excavated cavities and nest boxes ranged from 0.9 to 22.8 L, calculated between the cavity/nest box bottom and its entrance (Fig. S2a). The volume of nests ranged from 0.2 to 17.2 L (Fig. S2b), with the share of 3-87% of the cavity/ nest box volume. The extracted nests consisted of various nesting material in which we distinguished six types: moss (leafy shoots), bark (pine bark scales), fur and feathers (pieces of animal fur and feathers), leaves and grass (dry tree and grass leaves), putrefying material (remains of mammalian and bird prey, faeces and pellets in PO nests), and soil-like material (nesting material decomposed and accumulated over years). The share of the material types varied between the nest types ( Fig. S2c). For details on the analyses on the cavity and nest box parameters see the Supplementary material.

Nest extraction, sample treatment and arthropod identification
Nests were extracted from the nest boxes after opening the roof, pulling out the nesting material by hand, and storing it in plastic zipper bags. Nests in excavated cavities (found at height 1.2-7.5 m) were reached by climbing a ladder attached to a tree. For the extraction technique we were inspired by studies by Stanback and Koenig, (1994), and Ibarzabal & Tremblay, (2006). We drilled two 20 mm holes into the trunk on a diagonal, 15-40 cm below the cavity entrance (the distance depended on the actual cavity depth), cut out a wooden window of ca 10 × 10 cm using a cordless reciprocating saw, pulled out the nesting material by hand through the new hole and stored it in a plastic zipper bag. Thereafter we fastened the wooden block back, squeezed two wooden sticks into the drilled holes, filled all joints with linseed oil putty, and tied a hemp rope around the tree trunk to prevent knocking off of the cut-out wood from the inside of a cavity (Supplementary Material Fig.  S1). The extractions were always done with a permission from the land owner. The bags with nests were stored in a freezer at -20 °C for at least 1 week prior the extraction of arthropod individuals. This extraction was done by hand using tweezers after the nests had warmed themselves up to lab temperature. We separated all the arthropod individuals from the nesting material (excluding mites Acari as they would be difficult to separate from the frost-treated samples), and stored them in 70% ethanol in 50 ml tubes.
The identification of arthropods was done in two steps. (i) All the specimens were morphologically identified to species or higher taxonomic level. Beetles (Coleoptera) made up a large and diverse part of adult insects, and were identified to species-level by the author PM. The rest of the material was identified with varying taxonomic resolution. (ii) A subsample (n = 62 nests from the nest boxes) of all arthropods was analysed using DNA metabarcoding (Bioname Oy, Turku, Finland; details on the procedure are provided in Supplementary Material). Since not all the species in the samples were identified by this method, we did not use the results of DNA metabarcoding in the subsequent analyses, and we only show a species list in Appendix (Table 5). After arthropod separation, the nesting material was sorted out into the types described above, and their shares of the total nest volume (unit) were estimated using a laboratory tray of known dimensions.

Data analyses
We analysed data on arthropod communities separately for the two study areas. The effect of cavity type was analysed using the data from Turku area, including the 1 3 arthropods in two levels of cavity types (excavated cavities and medium-sized nest boxes). The effect of nest type was analysed using the data from Turku and Harjavalta study area, including the arthropods from seven levels of the nest types in Turku area (One-season, Accum, PO-hoard, PO-nest, PO-nest-old, Cav-pine, Cav-aspen) in one analysis, and data from two levels of nest types in Harjavalta area (great tit or pied flycatcher nests in small nest boxes) in the second analysis. The analyses for cavity type and nest type variables were conducted separately because they are hierarchical (i.e. cavity type medium-sized nest box includes five of the nest types and cavity type excavated cavity two of them).
We calculated Shannon diversity index (H′) for each nest using the 'diversity' function in R-package 'vegan' (Oksanen et al. 2022), taxa richness (TR) as the total number of arthropod taxa in each nest, and abundance of arthropods in the three feeding groups (carnivores, saprophages and parasites, see Appendix Table 4 for the classifications), in each nest. We compared the diversity indicators and arthropod abundance in feeding groups between the cavity types in one linear model and between the nest types in two linear models, one using data from Turku study area, and the second using data from Harjavalta study area (see above). We used indices H′, TR, and abundance in arthropod feeding groups as response variables. Predictor variables were cavity type or nest type or an interaction cavity type × feeding group or an interaction nest type × feeding group, where feeding group is a categorical variable with three levels (carnivores, saprophages and parasites). The variables nest volume, year, host species and active were the covariates, controlling for the unequal size of nests among the cavity types or nest types (Fig.  S2b), the different year of nest collection, the bird species we identified as the last breeder in the nest, and an active use (yes/no) of a nest for bird breeding in the current breeding season, respectively. We dropped host species from the models including nest type or nest type × feeding group predictors due to strong correlation of host identity with the nest type variable. Host species, year, and active covariates were not included in models using data from Harjavalta study area. We dropped parasitoids and xylophagous arthropods from respective analyses because they were rare in the collected nests, and the models would not be feasible with them. We assumed normal distribution for H′ and TR, and negative binomial distribution for the abundance in feeding groups. Visual inspection of QQ plots of the simulated residuals, provided by 'DHARMa' package (Hartig 2022), indicated that all the models met their assumptions. The values of both indicators and abundances in feeding groups were estimated as marginal means using function 'emmeans' in 'emmeans' package (Russell 2022), and compared between the cavity types or nest types, allowing for p-value adjustment by assuming multivariate t-distribution.
The relationships between arthropod communities and cavity types or nest types, or nesting material were investigated by multivariate analyses. First, we calculated a detrended correspondence analysis (DCA) on log-scaled [log(x + 1)] abundance of arthropod taxa for each subset to reveal any patterns in arthropod communities without including any predictors. We used a function 'decorana' in 'vegan' package. The next step was running three constrained correspondence analyses (CCA). The first two were run on log-scaled [log(x + 1)] abundance of arthropod taxa (response variable) where the cavity type or nest type (for each subset) was a predictor, and nest volume, year, and active were conditioning variables, i.e. variables which effect is "partialled out" (Oksanen et al. 2022). The third CCA included the same response variable, and volumes of particular types of nesting material as predictors and nest type, year, and active as conditioning variables. Host species was dropped from the CCAs to keep VIF (variance 1 3 inflation factor) below 10 for all predictors (Oksanen et al. 2022). We employed function 'cca' in 'vegan' package for conducting these tests.
Lastly, we investigated the strength of association between a specific arthropod taxa and cavity types or nest types. We employed a method using point-biserial correlation coefficient (r pb ). It is a Pearson's correlation coefficient calculated between abundance of a given species and a binary variable assigning 1 to sites for which we calculate the association in the species and 0 to all the other sites (De Cáceres and Legendre 2009). We calculated these associations using function 'strassoc' with association index set to 'r.g' (r pb taking different numbers of nests in the cavity types or nest types into account) and with 999 bootstrap samples for calculation of 95% CI of the index, in package 'indicspecies' (De Cáceres and Legendre 2009). Since the associations in combination of taxa can be stronger than in individual taxa (De Cáceres et al. 2012), we also allowed to combine up to three taxa in groups by function 'combinespecies' and tested their associations with nest types by function 'multipatt'. The association index was again set to 'r.g', and the statistical significance of the associations was tested by a permutation test with 999 permutations (De Cáceres and Legendre 2009). Unlike the analysis on the associations between a single arthropod taxa and cavity types or nest types, considering the combinations of taxa allows to identify which arthropods best characterize particular cavity types or nest types.
All the analyses were performed in R 4.1.3 (R Core Team 2022). For details on computation see the R-script using data sets aravailable in the Dryad repository at https:// doi. org/ 10. 5061/ dryad. sxksn 0382.

Arthropod taxa
Altogether we identified ten orders of arthropods, where Diptera, Coleoptera, Siphonaptera, and Lepidoptera formed the majority of the abundance (Fig. 2). The arthropods counted for 15 025 individuals sorted in 64 taxa (Appendix Table 4), and the maximum number of taxa found in each nest type ranged from ten (Small-PF) to 35 taxa (One-season; Table 1). We specify in Appendix (Table 4) if we identified, apart from the adults, also larvae or pupae.
DNA-metabarcoding identified 30 species (Appendix Table 5), excluding those apparently representing bird prey (not living in bird nests). This analysis provided a closer look at the identified taxa, especially at the diversity of Diptera flies and Lepidoptera moths, although only as presence data. Interestingly, it revealed the presence of Nasonia vitripennis (Hymenoptera), a parasitoid wasp, not identified by the other methods (probably because we did not open Diptera pupae when separating the arthropods from the nesting materials).

Arthropod community composition
The detrended correspondence analysis (DCA) showed no separation of the arthropod communities living in nests grouped into medium-sized nest boxes and excavated tree cavities (Fig. 5a), but suggested a separation of arthropod communities in Cav-aspen and PO-nest from the other nest types, in which the communities were shown as more similar to each other (Fig. 5b). For the small nest boxes, the analysis did not show any apparent  (Table 4), in nests grouped into (a, d, g) cavity types (excavated tree cavities and medium-sized nest boxes), and different nest types found in (b, e, h) medium-sized nest boxes and excavated cavities and (c, f, i) small nest boxes. Triangles and error bars are marginal means and their 95% CI, respectively. Different letters indicate significant differences in the variables between the nest types (small nest boxes were tested separately). Abundances are shown on a pseudo-log scale including zero. One-season nests of great tit built in the current breeding season, Accum accumulated nests of great tit, Cav-aspen accumulated nests of great and blue tit in common aspen, Cav-pine accumulated nests of great tit and pied flycatcher in Scots pine, PO-hoard nests containing old food hoards accumulated by pygmy owl, with fresh or accumulated great tit nests, PO-nest nests of pygmy owl, built in the current breeding season, PO-nest-old 1-3 years old nests of pygmy owl, with fresh or accumulated great tit nests on top, Small-GT nests of great tit in small nest boxes, Small-PF nests of pied flycatcher in small nest boxes 1 3 separation between P. major and F. hypoleuca nests (Fig. 5c). When considering the cavity type as a predictor, we observed a partial separation of communities in excavated tree cavities from the communities in medium-sized nest boxes according to a CCA (Fig. 5d, Table S3a). Regarding the analysis with the nest type as a predictor, we still observed a separation of communities in PO-nest and partially in Cav-aspen (Fig. 5e, Table S3b), where the latter type could host arthropod communities partially similar to those connected  (Table 4), and for taxa CCA scores see Supplementary Material Table S2a-c. One-season nests of great tit built in the current breeding season, Accum accumulated nests of great tit, Cav-aspen accumulated nests of great and blue tit in common aspen, Cav-pine accumulated nests of great tit and pied flycatcher in Scots pine, PO-hoard nests containing old food hoards accumulated by pygmy owl, with fresh or accumulated great tit nests, PO-nest nests of pygmy owl, built in the current breeding season, PO-nest-old 1-3 years old nests of pygmy owl, with fresh or accumulated great tit nests on top, Small-GT nests of great tit in small nest boxes, Small-PF nests of pied flycatcher in small nest boxes with the other nest types, including the PO-nest. Arthropods in small nest boxes formed similar communities in P. major and F. hypoleuca nests. (Fig. 5f), which was also indicated by a statistically non-significant effect of the nest type on the arthropod community composition (Table S3c). The arthropod communities found in nests in excavated cavities (pine and aspen cavities altogether) and in Cav-aspen nest type were similar to each other as shown by CCA (Fig. 5g, h), where some of rove beetles (Quedius spp.), larvae of beetles (Scarabaeoidea), hover fly pupae (Syrphidae), crane fly larvae (Tipulidae), millipedes (Julida) and Coleoptera pupae showed the closest relations. Clown beetles (Histeridae) were strongly associated to PO-nest, i.e. nests of G. passerinum. In the remaining nest types the taxa associations were less clear, as the communities were more similar to each other (Fig. 5h, i, also see Table S2 for exact CCA species' scores).
The CCAs relating arthropod communities to the volumes of particular types of nesting material did not show any significant relationships, tested by ANOVA permutation tests for the axes, both for medium-sized nest boxes and excavated cavities (Table S3d) and small nest boxes (Table S3e).

Arthropod associations with the cavity and nest types
We found twice as many taxa associated with nests in medium-sized nest boxes (13 taxa) than with nests in excavated cavities (6 taxa) according to point-biserial correlation coefficient (Table S4a). Namely, nests in medium-sized nest boxes hosted blowfly pupae (Protocalliphora sp.), moth pupae (Lepidoptera), fly pupae (Fanniidae), fleas (Ceratophyllus sp.), snake fly larvae (Raphidiidae), ants (Camponotus herculeanus and Formicidae), rove beetles (Atheta vaga, Haploglossa villosula and other Staphylinidae), skin beetle larvae (Dermestes sp.), and clown beetles (Gnathoncus buyssoni and G. nannetensis). Nests in excavated tree cavities hosted louse fly pupae (Ornithomya avicularia), crane fly larvae (Tipulidae), millipedes (Julida), darkling beetle (Alphitobius diaperinus), clown beetle (Dendrophilus corticalis), and rove beetle (Quedius brevicornis). A closer look into these taxa associations was provided by the analyses distinguishing the nest types ( Table 2). The fresh nests (One-season) were connected with four arthropod taxa (fleas Ceratophyllus sp., ants Formicidae, rove beetle Haploglossa villosula, and snake fly larvae Raphidiidae), while in accumulated nests (Accum) a strong association was found only in blowfly pupae (Protocalliphora sp.). But note that we also included empty blowfly puparia and their remnants, probably accumulated over the years, and thus the strength of the association in blow flies may be weaker than we calculated. In aspen cavities (Cav-aspen) we see significant associations in four different taxa (rove beetle Quedius brevicornis, crane fly larvae Tipulidae, millipedes Julida, and pupae of Coleoptera), but in pine cavities, Cav-pine, no associations were detected. Mainly Coleoptera were associated with PO-nests (clown beetles Gnathoncus nannetensis, G. communis, G. buyssoni, Margarinotus merdarius, but also Diptera fly larvae), two taxa were associated with PO-hoards (larvae and pupae of tineid moths Tineidae, and snake fly larvae Raphidiidae), and no taxon showed any connection with old pygmy owl nests (PO-nest-old). Lastly, in small nest boxes we found an association only in fleas (Ceratophyllus sp.) with the great tit nests (Small-GT, Table 2), and no significant relationship in pied flycatcher nests.
The analysis of the associations of combinations of taxa with the nest types showed that in Accum nest type the strongest association was still in blowfly pupae (Protocalliphora sp., bird ectoparasite), but other strong relationships were formed in groups of the other ectoparasites, tineid moth pupae and larvae (Tineidae), and centipedes (Lithobiomorpha) ( Table 3). In Cav-aspen strong group associations were formed by a rove beetle (Quedius brevicornis) and a Histeridae clown beetle (Gnathoncus buyssoni) together with Diptera fly larvae, and Coleoptera larvae and pupae. While in single taxa association in Cav-pine we did not find any significant relationships, here emerged the combinations of pupae of a bird ectoparasitic louse fly (Ornithomya avicularia), a beetle (Trox scaber), and moth pupae and larvae (Tineidae). In PO-hoard nest type we see, apart from the previously shown associations in moth pupae and larvae (Tineidae) and snake fly larvae (Raphidiidae), also fly pupae (Diptera) and pupae of louse flies (Ornithomya chloropus and O. avicularia), the bird ectoparasites. PO-nests were as in the single taxa analysis characterized by associations of clown beetles (Histeridae) and fly larvae (Diptera), although the r pb coefficients were higher when considering the combinations of the taxa (Table 3). Old PO nests contained groups of taxa formed by a clown beetle (Gnathoncus nannetensis) and ants (Formicidae), together with blowfly pupae (Protocalliphora sp.), tineid moth pupae and larvae (Tineidae), louse fly pupae (Ornithomya chloropus) and fly pupae (Diptera) ( Table 3).

Discussion
Our results show that there are some distinct differences in arthropod communities inhabiting different nest types of cavity breeding birds in boreal forests. We found that the community composition of woodpecker-size (typically by Dendrocopos major) cavities can in particular depend on nesting material accumulation and on food hoarding or nesting by the Eurasian pygmy owl. The effect of tree species was also apparent as different arthropod communities between aspen and pine cavities. The overall picture was that the distinct arthropod communities are living in pygmy owl nests and in aspen cavities.

Table 2 Associations between arthropod taxa and nest types as expressed by point-biserial correlation coefficient r pb (in parentheses)
Only taxa with positive associations (attraction) are shown. Note that for Cav-pine, PO-nest-old, and Small-PF nest types no associations were significant (p < 0.05). For complete output see Supplementary Table S4. Abbreviations are explained in Appendix (Table 4) One-season nests of great tit built in the current breeding season, Accum accumulated nests of great tit, Cavaspen accumulated nests of great and blue tit in common aspen, Cav-pine accumulated nests of great tit and pied flycatcher in Scots pine, PO-hoard nests containing old food hoards accumulated by pygmy owl, with fresh or accumulated great tit nests, PO-nest nests of pygmy owl, built in the current breeding season, POnest-old 1-3 years old nests of pygmy owl, with fresh or accumulated great tit nests on top, Small-GT nests of great tit in small nest boxes, Small-PF nests of pied flycatcher in small nest boxes. Number of nests in each nest type are provided One-season n = 27 Accum n = 15 Cav-aspen n = 14 PO-hoard n = 10 PO-nest n = 7 Small-GT n = 10 1 3

Excavated tree cavities and nest boxes
Our comparison of the arthropod diversity between nests in excavated tree cavities and nest boxes, previously rarely documented (but see McComb and Noble 1982), clearly shows that the artificial cavities cannot provide an adequate insight in arthropod diversity connected with natural cavities and bird nests built inside them. Although the basic diversity indices (Shannon diversity index and taxa richness) did not reveal any significant differences in arthropod community diversities between the cavity types (medium-sized nest boxes and excavated tree cavities), we found much more taxa associated with nests in medium-sized nest boxes, higher abundances in all of the feeding groups (parasitic, saprophagous, and carnivorous arthropods) in medium-sized nest boxes and their communities Table 3 The associations of arthropod taxa combinations (max three taxa) with nest types, expressed by point-biserial correlation coefficient r pb The statistical significance (p-value) of r pb was obtained by permutation tests (999 permutations). Only first five significant (p < 0.05) combinations are shown. Note that for One-season and Small-PF nest types no associations of taxa combinations were significant (p < 0.05). Taxa abbreviations are explained in Appendix (Table 4) Accum accumulated nests of great tit, Cav-aspen accumulated nests of great and blue tit in common aspen, Cav-pine accumulated nests of great tit and pied flycatcher in Scots pine, PO-hoard nests containing old food hoards accumulated by pygmy owl, with fresh or accumulated great tit nests, PO-nest nests of pygmy owl, built in the current breeding season, PO-nest-old 1-3 years old nests of pygmy owl, with fresh or accumulated great tit nests on top, Small-GT nests of great tit in small nest boxes. Number of nests in each nest type are provided were different from those in excavated cavities. This difference is in line with previous knowledge (McComb and Noble 1982), and with our expectation that different microclimate in nest boxes and excavated tree cavities (McComb and Noble 1981;Maziarz et al. 2017;Strain et al. 2021), which might result also from different dimensions among the cavity types, or the different nest histories could shape the communities differently between the cavity types. (We note that a longer time between fledging and our nest extraction in tree excavated cavities than in nest boxes might also have had some influence on the composition of arthropod communities.) We can also come to the same conclusions about the weak association of the ectoparasites, fleas (Ceratophyllus sp.), and parasitic arthropods in general with the nests in excavated tree cavities compared to the nests in nest boxes, as was found in cavities in temperate forests (Hebda and Wesolowski 2012). It suggests that some arthropods might have unexpectedly higher diversity or prevalence in artificial nest boxes, providing a more suitable environment for them than the excavated tree cavities. Regular cleaning prevents accumulation of the nesting material in the nest boxes. In contrast, excavated cavities are not cleaned or are only cleaned by some of the secondary cavity nesters (Wiebe et al. 2020). The long-term accumulation and decomposition of nesting material together with humid climate in the cavities (Maziarz and Wesołowski 2013;Maziarz et al. 2017) or even flooding of the cavities by rainfall (Wesolowski et al. 2002;Walters and Kneitel 2004) can transform the cavity environment significantly. Consequently, arthropods and other invertebrates requiring high moisture level or living in soil can dwell in the excavated cavities, as shown in our data by the presence of hover fly larvae (Syrphidae), crane fly larvae (Tipulidae), and earthworms (Lumbricinae). These species clearly pointed out that greatly different conditions can occur in tree cavities compared to nest boxes (Maziarz et al. 2017). Based on this fact, we should bear in mind that even though the installation of nest boxes could be perceived as a conservation measure supporting the complex arthropod diversity found in bird nests, some arthropods would probably not benefit from them.

Nest types
Our results showed that Eurasian pygmy owl nests tended to exhibit the most distinct parameters describing the arthropod communities, as seen by the Shannon diversity index and taxa richness. The situation is more complicated for the abundance in the feeding groups, where we found other specific differences between the nest types, mentioned below. Overall, we did not find as many significant differences between the nest types as could have been be expected. The reasons for this pattern could include: similarities in nest structure between some of the nest types as a lot of the nests were built by great tits, a common species pool of the colonizing arthropods across the study areas, or the fact that we were not able to reach high taxonomic resolution for all our arthropod samples, i.e. the species level.

Pygmy owl nests and food hoards
Pygmy owl nests revealed a distinctly different diversity of arthropods, most probably related to a specific structure of the "nests". It is considered that owls do not build a nest (König and Weick 2008), but pygmy owls use remains of fur or feathers of prey as a lining that provides a soft surface for the eggs and chicks. Also during breeding, a part of the prey remains accumulates in the cavity, attracting especially various Coleoptera species, here reflected in high abundance of carnivorous arthropods in this nest type, and Diptera (larvae), which are known dwellers of the nests of other owl species (Krištofík et al. 2003;Majka et al. 2006;Cosandey et al. 2021) and birds of prey (Krištofík et al. 2009;Levesque-Beaudin et al. 2020;Lynch et al. 2020). The old pygmy owl nests, however, hosted arthropod community different from active nests and, at the same time, more similar to communities in one-season and accumulated nests of great tits. Apparently, this change in the arthropods reflected the change in the nest environment when great tits bred after the pygmy owls in the nest boxes. The remains of pygmy owls' food hoards, formed mostly by small rodent carcasses, were expected to attract various carrion-related arthropods. Nonetheless, the arthropod communities in PO food hoards were similar to those in accumulated and one-season old tit nests, likely because the nest boxes with food hoards also contained nesting material collected by great tits, i.e. mainly moss and fur, which might be the reason for the similarities in those arthropod communities. An important role of pygmy owl in modifying the nest box environment, subsequently favouring specific feeding groups of arthropods, was indicated in high abundances of saprophagous arthropods in all three PO-related nest types, in contrast with their low abundances in nests of great tits (One-season) built in the same type of nest boxes.

One-season old and accumulated nests
Nest box cleaning is a common maintenance practice ensuring that enough space for building a new nest is available and lowering the load of some bird ectoparasites (Rendell and Verbeek 1996;Mazgajski 2007;Tomás et al. 2007). We found similar arthropod diversities in woodpecker-size nest boxes cleaned prior to the breeding season and in nesting material that had accumulated over several years. Some taxon-specific and feeding group differences were, however, found. In fleas (Ceratophyllus sp.) we found a strong association with fresh nests, contradicting the higher abundance of this ectoparasite found in nest boxes containing old nest material than in cleaned nest boxes (Rendell and Verbeek 1996;Tomás et al. 2007). The other ectoparasite, a blow fly (Protocalliphora sp.), was strongly associated with accumulated nests in our study system, which, however, might also result from the accumulation of the empty puparia and their remnants in the nests over the years. Although our finding concurs with a higher abundance of blow fly pupae found in nests with old material than in newly built nests by blue tit (Tomás et al. 2007), fresh and old nests of the other cavity-breeding bird species, tree swallow (Tachycineta bicolor) hosted comparable abundances of Protocalliphora sp. (Rendell and Verbeek 1996). The example of these two ectoparasite species suggests that less frequent cleaning of the nest boxes by people may not lead to an increased abundance of some bird ectoparasites, and actually it could be a useful measure supporting arthropod diversity (Jaworski et al. 2022). From a wider perspective of all available cavities, we showed that both cleaned nest boxes and those containing accumulated materials could provide better environment for parasitic arthropods than the other nest types, including excavated cavities in trees. Therefore, supplementing the artificial cavities seems to support this arthropod group in any case. A more complicated situation comes when we would like to support both the saprophagous and carnivorous arthropods, which responded in a contrasting pattern to nest boxes cleaning.
The filling up of natural cavities via accumulation of nesting materials can be very slow because the organic matter can decompose in the cavities very rapidly between the consecutive breeding seasons (Wesołowski 2000;Hebda and Mitrus 2011;Hebda et al. 2013). Such rapid decomposition rates were observed in tree cavities in temperate mixed forest. In boreal Europe the decomposition process is probably much slower as we found quite large amounts of accumulated nesting materials in tree cavities, especially in aspen ones. Therefore, the latitude may also affect the availability of decomposed nesting materials for arthropods in excavated cavities.
It is good to note that an absence of actively breeding birds in some accumulated nests, and also in some nests in the other nest types (see Methods), in the year of nest collection might have shaped the arthropod communities differently compared to nests in which we documented active breeding prior to our nest extraction. Bird breeding can provide food resources for the arthropods (eg. blood, skin cells and faeces from the chicks, and fresh plant materials) as well as it importantly changes the cavity microclimate (Sudyka et al. 2022). Consequently, the arthropods requiring these specific conditions might not be attracted into the nests not actively used by birds for breeding in the year of nest collection.

Tree cavity nests
The comparison of arthropod taxa in nests in pine and aspen cavities was interesting because arthropods in cavity-breeding birds' nests have previously been mainly studied in nest boxes. The arthropod community composition was substantially different between pine and aspen ( Fig. 5h), indicating the importance of tree species identity when assessing arthropod communities in excavated cavities. We also found apparently more arthropod taxa in the latter type, even though this difference was not statistically different, and may be partially due to more nests we collected from aspen cavities. We can assume that the much drier interior of pine than aspen cavities (pers. obs.) and the presence of highly decomposed material in aspen cavities (soil-like structure, Fig. S2c) could be the important factors shaping the composition of arthropod communities differently between the pine and aspen cavities.

Nests in small nest boxes
The lower arthropod diversity found in smaller nest boxes (Small-GT, Small-PF) could be related to the smaller volume of the nesting material. Boyes & Lewis (2019) found an indication of a relationship between the abundance of Tineidae moths and the mass of bird nests. They suggested that the volume of the nests should be also measured to reflect the different density of nesting materials and space available for the moths. For this specific reason we estimated the volume and not the mass of particular nesting materials. Obviously, a volume unit of different materials can have substantially different weight, for instance, when comparing the fur and feathers to soil-like material. Regarding the arthropod diversity, we found a positive arthropod association only in fleas in great tit nests in the small nest boxes, which concurs with the conclusion of a literature review that great tit nests used to be more heavily infested by fleas than pied flycatcher nests (Bauchau 1998). This result also matches with our other finding of a higher abundance of parasitic arthropods in small great tit than pied flycatcher nests. Due to an indication of the lower diversity of arthropods found in small compared to medium-sized nest boxes, we recommend to consider whether preferably the larger nest boxes (e.g. woodpecker-sized types used in this study) could be installed, to accommodate a greater amount of nesting materials and thus potentially hosting more arthropod species.

Arthropod functional groups in the nests of cavity-breeders
The arthropod communities in nests of cavity-breeding birds covered various functional groups based on feeding behaviour. Apart from species like tineid moths (Tineidae), feeding on plant remains, keratin in feathers or fungi in nesting material (Sato et al. 2019), we could observe trophic interactions between the species living in bird nests. Illustratively, the abundant Diptera larvae feed on carrion and animal matter remains in the nest (Krištofík et al. 2017;Levesque-Beaudin et al. 2020) and clown beetles (Histeridae) feed on these larvae or eggs of Diptera (Geden and Axtell 1988;Kovarik and Caterino 2000). Blow fly larvae (Protocalliphora sp.) parasitize on nestlings (Eeva et al. 2015), and a parasitoid wasp (Nasonia vitripennis) parasitizes on the blow flies as a hyperparasite (on larvae or pupae; Desjardins et al. 2010). The strong attraction of fleas (Ceratophyllus sp.) and a rove beetle (Haploglossa villosula) to one-season nests may come from predator-prey relationship, a pattern that is assumed in related species (C. styx and H. nidicola) found in burrow nests of sand martin (Riparia riparia) (Krištofík et al. 1994). These examples show that various arthropods can hold different positions in a complex food chain formed in bird nests. Birds, and especially their nestlings, are naturally involved in the chain, where the ectoparasites have presumably the highest (negative) impact on them. On the other hand, the birds could benefit from the present arthropod predators, if they feed on the parasites, and from saprophagous/detritivorous arthropods participating in cleaning of the nests. It has been shown experimentally that the increased abundance of saprophagous fly larvae (Fannia spp.), the Diptera flies we also found in the communities, was associated with increased fitness of the chicks of European bee-eater (Merops apiaster) in their nesting burrows (Krištofík et al. 2017). Apparently, from the bird perspective, the role of arthropods can range from significantly detrimental to potentially beneficial.
The presence of specific functional groups, or distinctive arthropod communities in general, in the nests could also relate to the nesting materials or substrates forming the nests. However, few studies have shown any direct relationships between the types of nesting materials and the arthropod diversity (but see Boyes and Lewis 2019). Similarly, our analysis on the effect of the volume of particular nesting materials did not provide any evidence for such relationships, even though the importance of specific nesting materials, like PO nests or soil-like material, for arthropods indirectly implies from our other results.

Competing interests
The authors have no relevant financial or non-financial interests to disclose.
Species representing bird prey, or not living in bird nests were excluded Feeding group represents the main functional feeding groups of the taxa: sap saprophagous, car carnivorous, fun fungivorous, xyl xylophagous, hae haematophagous, par parasite, prs parasitoid. One-season nests of great tit built in the current breeding season, Accum accumulated nests of great tit, PO-hoard nests containing old food hoards accumulated by pygmy owl, with fresh or accumulated great tit nests, PO-nest nests of pygmy owl built in the current breeding season, PO-nest-old 1-3 years old nests of pygmy owl, with fresh or accumulated great tit nests on top, Small-GT nests of great tit in small nest boxes, Small-PF nests of pied flycatcher in small nest boxes *DNA-metabarcoding determined this species as Protocalliphora spatulata, which is, however, a North American species (Sabrosky et al. 1989); we assume P. azurea is the species found in our arthropod samples a Larva, b adult