Working code of Factory passing courseDefXML to both controllers