refactor system into submodules