refactors git operations into a class