itml: cleaning and factorize.