make dwtc more general