Complex sentence: The main purpose of the building is madrasa which taught all four Islamic schools of jurisprudence, and had been undergoing renovation which completed in 2001.
Split into simpler sentences: The main purpose of the building is madrasa which taught all four Islamic schools of jurisprudence. It had been undergoing renovation which completed in 2001.