Some refactorings to improve wildcard performance on debug CTS builds