broke out core functionality into a separate submodule