The immense amount of wastewater from refineries cannot be sent directly to public treatment facilities; the water used in refinery processes end up with varying degrees of contamination and contain liquid hydrocarbons, suspended solids, mercaptans, phenols, amines, acids, and cyanides. Wastewater may be classified into four categories: cooling water, process water and steam, storm water, and sanitary sewage water. Of these four types, process water and steam are considered to be the most contaminated due to the fact that they are in direct contact with petroleum fractions. The water may be characterized using several measurements, which include Biochemical Oxygen Demand, Chemical Oxygen Demand, suspended solids, hydrocarbon content, nitrogen content, phenol content, and acidity. The paramount rule in wastewater treatment is to avoid mixing different streams of wastewater, since the pollutants in each stream differ and mixing causes treatment processes to become more complicated. Each stream must be treated separately before being sent to a public treatment facility. Treatment processes may be divided into primary (physical) processes – such as stripping hydrogen sulfide and skimming oil – and secondary (biological) processes – utilizing biological microorganisms to remove organic contaminants. Wastewater treatment is dictated by environmental regulations imposed on refineries. These include the Clean Water Act and the Safe Drinking Water Act.