externalizable templates, some fixes