Refactor project.matches_branch? prototype