Consumes migration of DT code

Rebase of  #2926. Only change WRT original is the name of the variables.