Fix branch that always opent /compare when use option --branch
Refactor code