Add support for legacy template