Make domain word counting dynamic