What is the meaning of Refinery?

A building, or a mass of machinery, used to produce refined products such as sugar, oil, or metals.

Source: wiktionary.org