Restructuring for modularity