Improve factory interface lookup logic.