Restructing code