Refactoring for use as a git submodule