Would it be cleaner to use the `branches` method here, and then filter the array of branches in Ruby?