learning-switch: Refactor wildcards calculation.