Building domain classes