Refactor branch fetching method in Configuration class