Modularity refactoring