Refactor Git repository helpers