importTemplate handle with non standard header and others improvements