Restructuring code in packages