Refactor branch inspector