Domain UI: Fix for searching domains and the move to factory

I just converted the existing code to factory.