What are the primary functions of the church?