Extract domain matchin in a method