change require of domains into a function call