Homeotic genes play a key regulatory role in the two innermost germ layers of Drosophila, the visceral mesoderm and the endoderm. Here, they control, and are controlled by, genes that encode extracellular proteins involved in signalling. Examples of these regulatory interactions are an inductive process between the two germ layers, and an indirect autoregulatory loop of a homeotic gene in the visceral mesoderm. Both these mechanisms define or redefine spatial domains of homeotic gene expression, by way of intercellular communication. The homeotic genes that are expressed in the viscera control morphogenesis and differentiation of the larval midgut.