 Regular cleaning is done through the use of a maintenance "pig", a device that passes through a pipeline, scraping and cleaning the inside walls.In addition, maintenance also includes the occasional use of a "smart pig", a device that contains instruments that can measure and test the condition of the pipeline, including the detection of corrosion damage.Ultrasonic testing and the use of "corrosion coupons" are also used to detect corrosion.