Superconformal indices of four-dimensional N = 1 gauge theories factorize into holomorphic blocks. We interpret this as a modular property resulting from the combined action of an SL(3, Z) and SL(2, Z) Z 2 transformation. The former corresponds to a gluing transformation and the latter to an overall large diffeomorphism, both associated with a Heegaard splitting of the underlying geometry. The extension to more general transformations leads us to argue that a given index can be factorized in terms of a family of holomorphic blocks parametrized by modular (congruence sub)groups. We find precise agreement between this proposal and new modular properties of the elliptic Γ function. This allows us to establish the "modular factorization" of superconformal lens indices of general N = 1 gauge theories. Based on this result, we systematically prove that a normalized part of superconformal lens indices defines a non-trivial first cohomology class associated with SL(3, Z). Finally, we use this framework to propose a formula for the general lens space index.