Refactored component matching.