little refactoring in remote_branch