In this paper I investigate the optimal level of decentralization of tasks for the provision of a local public good. I enrich the well-known trade-off between internalization of spillovers (that favors centralization) and accountability (that favors decentralization) by considering that public goods are produced through multiple tasks. This adds an additional institutional setting, partial decentralization, to the classical choice between full decentralization and full centralization. The main results are that partial decentralization is optimal when both the variance of exogenous shocks to electorate´s utility is large and the electorate expects high performance from politicians. I also show that the optimal institutional setting depends on the degree of substitutability/complementarity between tasks. In particular, I show that a large degree of substitutability between tasks makes favoritism more likely, which increases the desirability of partial decentralization as a safeguard against favoritism.