refactored code to abstract jgit usage