rearranging for use as submodule