Domain tests and functions