There are diverse physiological functions of nitrogen end products in different animal groups, including excretion, acid-base regulation, osmoregulation and buoyancy. Animals excrete a variety of nitrogen waste products, but ammonia, urea and uric acid predominate. A major factor in determining the mode of nitrogen excretion is the availability of water in the environment. Generally, aquatic animals excrete mostly ammonia, whereas terrestrial animals excrete either urea or uric acid. Ammonia, urea and uric acid are transported across cell membranes by different mechanisms corresponding to their different chemical properties in solution. Ammonia metabolism and excretion are linked to acid-base regulation in the kidney, but the role of urea and uric acid is less clear. Both invertebrates and vertebrates use nitrogen-containing organic compounds as intracellular osmolytes. In some marine invertebrates, NH4+ is sequestered in specific compartments to increase buoyancy.