Restructuring to submodules