Refactor git plugin slightly