The monastery's primary purpose was as the living quarters and work place of monks or nuns, living in communities or in smaller hermitages alone - as hermits. There is typically a place of worship, which may be a chapel, church or temple, allowing residents to pray. Monastic complexes also may have provided wider facilities such as a refectory, infirmary or a library, in order to facilitate education or community services, or self sufficiency for the residents.