start restructuring code