The reduction or elimination of contaminants, or altering the nature of the wastewater before it is discharged.