rewrite to use submodules