Restructuring of code