Restructures code