improve domain/range patterns