Rename domains factory to a slightly better name

Also, track by ID instead of name