improve branch url parsing