The skin continues internally as the lining of the intestine and lung. In the intestines or lungs, movement by peristalsis or cilia helps to remove infectious agents. Also, mucus traps infectious agents. In the intestines, gut flora can prevent pathogenic bacteria by secreting toxic substances, or by competing with pathogenic bacteria for nutrients or for attachment to cell surfaces.