Restructures. Seems functional