removing repository and branch management code from the controllers