Fix field ordering confusion (domain <-> user)

Also DRY a redundant ordering logic to avoid future errors.

I tested it on my setup and it seems not to affect order of already-exisitng-records, but worth a validation.