Moved search func to factory.