basic implementation using domains