move common code to a submodule