refactor branch tests