Be less strict about factories being replaced if the global function is the same