move ddlnode cration into factory function.